refactor: simplify db_path method by using push with match expression

This commit is contained in:
monosans
2026-01-06 17:41:26 +03:00
parent d569d3a684
commit 3d92eef4f6
3 changed files with 6 additions and 4 deletions
Submodule
+1
Submodule crossterm added at 36d95b26a2
Submodule
+1
Submodule ratatui added at 0a2a7c0363
+4 -4
View File
@@ -34,10 +34,10 @@ impl DbType {
async fn db_path(self) -> crate::Result<PathBuf> {
let mut cache_path = get_cache_path().await?;
match self {
Self::Asn => cache_path.push("asn_database.mmdb"),
Self::Geo => cache_path.push("geolocation_database.mmdb"),
}
cache_path.push(match self {
Self::Asn => "asn_database.mmdb",
Self::Geo => "geolocation_database.mmdb",
});
Ok(cache_path)
}