fixup: dont validate current task data

This commit is contained in:
Dmitriy Pleshevskiy 2022-08-16 16:06:25 +03:00 committed by Gitea
parent 512514f721
commit bcc4e59c12
No known key found for this signature in database
GPG key ID: 55B75599806CD426

View file

@ -175,10 +175,9 @@ impl Repository for FsRepo {
impl FsRepo {
fn get_current_task_impl(&self) -> Result<Option<CurrentTaskInfo>, 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<CurrentTaskInfo>) -> Result<(), Error> {