Improve syntax

This commit is contained in:
Emilia Hane
2023-01-11 13:38:43 +01:00
parent 3c0aa201e3
commit 3679a0f1cb
2 changed files with 16 additions and 20 deletions

View File

@@ -168,10 +168,9 @@ impl Config {
/// Get the blobs freezer DB path, creating it if necessary.
pub fn create_blobs_freezer_db_path(&self) -> Result<Option<PathBuf>, String> {
if let Some(blobs_freezer_path) = self.get_blobs_freezer_db_path() {
Ok(Some(ensure_dir_exists(blobs_freezer_path)?))
} else {
Ok(None)
match self.get_blobs_freezer_db_path() {
Some(blobs_freezer_path) => Ok(Some(ensure_dir_exists(blobs_freezer_path)?)),
None => Ok(None),
}
}