Skip to content

Commit c82be2f

Browse files
committed
Prefer 'match' pattern guard over conditional within body.
1 parent 8adc3f7 commit c82be2f

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/libstd/path.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -393,11 +393,8 @@ fn iter_after<A, I, J>(mut iter: I, mut prefix: J) -> Option<I>
393393
loop {
394394
let mut iter_next = iter.clone();
395395
match (iter_next.next(), prefix.next()) {
396-
(Some(x), Some(y)) => {
397-
if x != y {
398-
return None;
399-
}
400-
}
396+
(Some(ref x), Some(ref y)) if x == y => (),
397+
(Some(_), Some(_)) => return None,
401398
(Some(_), None) => return Some(iter),
402399
(None, None) => return Some(iter),
403400
(None, Some(_)) => return None,

0 commit comments

Comments
 (0)