Skip to content

Commit

Permalink
Simplify default mods
Browse files Browse the repository at this point in the history
  • Loading branch information
torymur committed Jan 17, 2025
1 parent e76ef3b commit 95a9b97
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ rustc-hash = "2.1.0"
regex-automata = "0.4.9"

[features]
default = ["python-bindings"]
python-bindings = ["pyo3"]

[lib]
Expand Down
13 changes: 2 additions & 11 deletions src/vocabulary/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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, " ")
}
}

Expand Down

0 comments on commit 95a9b97

Please sign in to comment.