From 95a9b9753c22aefec2f796eb657c5d2048f6053b Mon Sep 17 00:00:00 2001 From: "Victoria Terenina (torymur)" Date: Fri, 17 Jan 2025 11:41:37 +0000 Subject: [PATCH] Simplify default mods --- Cargo.toml | 1 - src/vocabulary/processor.rs | 13 ++----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4b95c0d..f49df1a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,6 @@ rustc-hash = "2.1.0" regex-automata = "0.4.9" [features] -default = ["python-bindings"] python-bindings = ["pyo3"] [lib] diff --git a/src/vocabulary/processor.rs b/src/vocabulary/processor.rs index b962a24..f4b95e5 100644 --- a/src/vocabulary/processor.rs +++ b/src/vocabulary/processor.rs @@ -93,19 +93,10 @@ pub(crate) struct Mods { spacechar: String, } -impl Default for Mods { - /// Default string modification to be applied by `TokenProcessor` of `ByteFallback` level. - fn default() -> Self { - Self { - spacechar: ' '.to_string(), - } - } -} - impl Mods { - /// Apply default modifications to each token. + /// Default string modification to be applied by `TokenProcessor` of `ByteFallback` level. fn apply_default(&self, token: &str) -> String { - token.replace(&self.spacechar, &Self::default().spacechar) + token.replace(&self.spacechar, " ") } }