A file-based task manager
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Cleanup more unwrap/expect

+3 -6
+3 -6
src/main.rs
··· 209 209 } 210 210 211 211 fn command_list(dir: PathBuf, all: bool, count: usize) -> Result<()> { 212 - let workspace = Workspace::from_path(dir).expect("Unable to find .tsk dir"); 212 + let workspace = Workspace::from_path(dir)?; 213 213 let stack = if all { 214 214 workspace.read_stack()? 215 215 } else { ··· 268 268 } 269 269 270 270 fn command_find(dir: PathBuf, full_id: bool) -> Result<()> { 271 - let id = Workspace::from_path(dir).unwrap().search(None).unwrap(); 271 + let id = Workspace::from_path(dir)?.search(None)?; 272 272 if let Some(id) = id { 273 273 if full_id { 274 274 println!("{id}"); ··· 284 284 } 285 285 286 286 fn command_reprioritize(dir: PathBuf, task_id: TaskId) -> Result<()> { 287 - // unwrap is safe here because clap will ensure we have at least one of these 288 - Workspace::from_path(dir) 289 - .unwrap() 290 - .reprioritize(task_id.into()) 287 + Workspace::from_path(dir)?.reprioritize(task_id.into()) 291 288 }