Skip to content

Commit

Permalink
fix: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
fundon committed Jan 15, 2024
1 parent d3d5094 commit fc17846
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,8 @@ impl<T: fmt::Debug> Node<T> {
}
})
.enumerate()
.find_map(|(n, b)| {
if s[0] != *b {
return None;
}
.filter_map(|(n, b)| (s[0] == *b).then_some(n))
.find_map(|n| {
node._find(start + n, &bytes[n..], ranges).map(|id| {
ranges.push(start..start + n);
id
Expand Down Expand Up @@ -343,15 +341,18 @@ impl<T: fmt::Debug> Node<T> {
m >= s.len()
};
if right_length {
return bytes.iter().enumerate().find_map(|(n, b)| {
if s[0] != *b {
return None;
}
node._find(start + n, &bytes[n..], ranges).map(|id| {
ranges.push(start..start + n);
id
})
});
return bytes
.iter()
.enumerate()
.filter_map(|(n, b)| (s[0] == *b).then_some(n))
.find_map(|n| {
node._find(start + n, &bytes[n..], ranges).map(
|id| {
ranges.push(start..start + n);
id
},
)
});
}
}
None
Expand Down

0 comments on commit fc17846

Please sign in to comment.