fixup: dont validate current task data #16

Merged
pleshevskiy merged 1 commit from repo into main 2022-08-16 16:07:06 +03:00
Showing only changes of commit 2ca0d66136 - Show all commits

View file

@ -175,10 +175,9 @@ impl Repository for FsRepo {
impl FsRepo { impl FsRepo {
fn get_current_task_impl(&self) -> Result<Option<CurrentTaskInfo>, Error> { fn get_current_task_impl(&self) -> Result<Option<CurrentTaskInfo>, Error> {
let file_path = self.xdg_dirs.get_data_file(CURRENT_TASK_FILE); let file_path = self.xdg_dirs.get_data_file(CURRENT_TASK_FILE);
File::open(&file_path) Ok(File::open(&file_path)
.ok() .ok()
.map(|file| serde_json::from_reader(file).map_err(|_| Error::InvalidData)) .and_then(|file| serde_json::from_reader(file).ok()))
.transpose()
} }
fn save_current_task_impl(&self, cur_task: Option<CurrentTaskInfo>) -> Result<(), Error> { fn save_current_task_impl(&self, cur_task: Option<CurrentTaskInfo>) -> Result<(), Error> {