refactor: simplify db_path method by using push with match expression
This commit is contained in:
Submodule
+1
Submodule crossterm added at 36d95b26a2
Submodule
+1
Submodule ratatui added at 0a2a7c0363
+4
-4
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user