From d38c4ac55ea68ae6dd0262ddd95150b7d46bf93b Mon Sep 17 00:00:00 2001 From: Vika Date: Tue, 10 May 2022 01:37:03 +0300 Subject: FileStorage: code cleanup --- src/database/file/mod.rs | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'src/database') diff --git a/src/database/file/mod.rs b/src/database/file/mod.rs index 64d9564..031527e 100644 --- a/src/database/file/mod.rs +++ b/src/database/file/mod.rs @@ -171,12 +171,11 @@ fn modify_post(post: &serde_json::Value, update: &serde_json::Value) -> Result Result if err.kind() == IOErrorKind::NotFound { HashMap::default() - } else { Err(err)? } + } else { + return Err(err.into()) + } }; settings.insert(setting, value); tempfile.write_all(serde_json::to_string(&settings)?.as_bytes()).await?; -- cgit 1.4.1