From 3d92eef4f638aa6ed8a30e188f9e96ea8d3da1f9 Mon Sep 17 00:00:00 2001 From: monosans Date: Tue, 6 Jan 2026 17:41:26 +0300 Subject: [PATCH] refactor: simplify db_path method by using push with match expression --- crossterm | 1 + ratatui | 1 + src/ipdb.rs | 8 ++++---- 3 files changed, 6 insertions(+), 4 deletions(-) create mode 160000 crossterm create mode 160000 ratatui diff --git a/crossterm b/crossterm new file mode 160000 index 0000000..36d95b2 --- /dev/null +++ b/crossterm @@ -0,0 +1 @@ +Subproject commit 36d95b26a26e64b0f8c12edfe11f410a6d56a812 diff --git a/ratatui b/ratatui new file mode 160000 index 0000000..0a2a7c0 --- /dev/null +++ b/ratatui @@ -0,0 +1 @@ +Subproject commit 0a2a7c0363a4806b0cf05c1915bf7cdd438f756c diff --git a/src/ipdb.rs b/src/ipdb.rs index b46f833..5673007 100644 --- a/src/ipdb.rs +++ b/src/ipdb.rs @@ -34,10 +34,10 @@ impl DbType { async fn db_path(self) -> crate::Result { 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) }