Apply more lints
This commit is contained in:
parent
0c92bf959b
commit
1e1dd7b877
24 changed files with 61 additions and 63 deletions
|
|
@ -1,6 +0,0 @@
|
|||
use token::Token;
|
||||
|
||||
pub mod token;
|
||||
pub mod word_tokenizer;
|
||||
|
||||
pub type Tokenizer<T> = dyn Fn(&str) -> Vec<Token<T>>;
|
||||
|
|
@ -17,8 +17,8 @@ where
|
|||
impl From<&str> for Token<String> {
|
||||
fn from(s: &str) -> Self {
|
||||
Token {
|
||||
normalised: s.to_string(),
|
||||
original: s.to_string(),
|
||||
normalised: s.to_owned(),
|
||||
original: s.to_owned(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,6 @@ use super::token::Token;
|
|||
|
||||
pub fn word_tokenizer(text: &str) -> Vec<Token<String>> {
|
||||
text.split_inclusive(char::is_whitespace)
|
||||
.map(|s| Token::new(s.to_string(), s.to_string()))
|
||||
.map(|s| Token::new(s.to_owned(), s.to_owned()))
|
||||
.collect()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue