diff --git a/Cargo.toml b/Cargo.toml index e9d27281..917e73ff 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,7 @@ indexmap = "2.7.0" itertools = "0.14.0" libspelling = "0.3.0" openssl = "0.10.68" -plurify = "0.1.1" +plurify = "0.2.0" syntect = "5.2.0" # development diff --git a/src/app/browser/window/tab/item/page/search/form/result.rs b/src/app/browser/window/tab/item/page/search/form/result.rs index 0a1053e2..1d9fd2ec 100644 --- a/src/app/browser/window/tab/item/page/search/form/result.rs +++ b/src/app/browser/window/tab/item/page/search/form/result.rs @@ -29,8 +29,9 @@ impl Result { // Actions pub fn update(&self, current: Option, total: usize) { + use plurify::*; if total > 0 { - let matches = plurify::ns(total, &["match", "matches", "matches"]); + let matches = total.plurify(&["match", "matches", "matches"]); match current { Some(position) => self .label diff --git a/src/tool.rs b/src/tool.rs index 1fe43cb6..cd18ed27 100644 --- a/src/tool.rs +++ b/src/tool.rs @@ -7,6 +7,8 @@ pub trait Format { impl Format for usize { fn bytes(self) -> String { + use plurify::*; + const KB: f32 = 1024.0; const MB: f32 = KB * KB; const GB: f32 = MB * KB; @@ -14,7 +16,7 @@ impl Format for usize { let f = self as f32; if f < KB { - format!("{self} {}", plurify::ns(self, &["byte", "bytes", "bytes"])) + format!("{self} {}", self.plurify(&["byte", "bytes", "bytes"])) } else if f < MB { format!("{:.2} KB", f / KB) } else if f < GB {