refactor: apply clippy hints
This commit is contained in:
parent
6523964125
commit
3719464054
1 changed files with 2 additions and 5 deletions
|
|
@ -78,14 +78,11 @@ fn nodes_from_str(s: &str) -> Result<Vec<Node>, Error> {
|
|||
let mut nodes = Vec::new();
|
||||
let mut state = ParsingState::default();
|
||||
|
||||
let is_ignored_char = |c: &char| match c {
|
||||
' ' | '&' => false,
|
||||
_ => true,
|
||||
};
|
||||
let is_ignored_char = |c: &char| !matches!(c, ' ' | '&');
|
||||
|
||||
let filtered_string: String = s.chars().filter(is_ignored_char).collect();
|
||||
|
||||
for (i, c) in filtered_string.chars().enumerate() {
|
||||
for (i, c) in filtered_string.char_indices() {
|
||||
let mut start = false;
|
||||
match state {
|
||||
ParsingState::Start => start = true,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue