From bcc4e59c12893f3200e800f0cb36100740b3000f Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Tue, 16 Aug 2022 16:06:25 +0300 Subject: [PATCH] fixup: dont validate current task data --- src/repo/fs.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/repo/fs.rs b/src/repo/fs.rs index aeaa29c..3c4bb07 100644 --- a/src/repo/fs.rs +++ b/src/repo/fs.rs @@ -175,10 +175,9 @@ impl Repository for FsRepo { impl FsRepo { fn get_current_task_impl(&self) -> Result, Error> { let file_path = self.xdg_dirs.get_data_file(CURRENT_TASK_FILE); - File::open(&file_path) + Ok(File::open(&file_path) .ok() - .map(|file| serde_json::from_reader(file).map_err(|_| Error::InvalidData)) - .transpose() + .and_then(|file| serde_json::from_reader(file).ok())) } fn save_current_task_impl(&self, cur_task: Option) -> Result<(), Error> {