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 nodes = Vec::new();
|
||||||
let mut state = ParsingState::default();
|
let mut state = ParsingState::default();
|
||||||
|
|
||||||
let is_ignored_char = |c: &char| match c {
|
let is_ignored_char = |c: &char| !matches!(c, ' ' | '&');
|
||||||
' ' | '&' => false,
|
|
||||||
_ => true,
|
|
||||||
};
|
|
||||||
|
|
||||||
let filtered_string: String = s.chars().filter(is_ignored_char).collect();
|
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;
|
let mut start = false;
|
||||||
match state {
|
match state {
|
||||||
ParsingState::Start => start = true,
|
ParsingState::Start => start = true,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue