From cd5cd37ecc569316e479fbeb91010f76bb30d778 Mon Sep 17 00:00:00 2001 From: Gwen Lg Date: Sun, 25 Jan 2026 18:50:42 +0100 Subject: [PATCH] style: improve lisibility of db_path code split suffix get from match self and path construction --- src/db/open.rs | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/db/open.rs b/src/db/open.rs index ed264752..dad0492a 100644 --- a/src/db/open.rs +++ b/src/db/open.rs @@ -26,19 +26,12 @@ impl Engine { /// Return engine-specific DB path from base path pub fn db_path(&self, base_path: &Path) -> PathBuf { - let mut ret = base_path.to_path_buf(); - match self { - Self::Lmdb => { - ret.push("db.lmdb"); - } - Self::Sqlite => { - ret.push("db.sqlite"); - } - Self::Fjall => { - ret.push("db.fjall"); - } - } - ret + let suffix = match self { + Self::Lmdb => "db.lmdb", + Self::Sqlite => "db.sqlite", + Self::Fjall => "db.fjall", + }; + base_path.join(suffix) } }