Skip to content

Commit cefbe50

Browse files
committed
Rollup merge of #31878 - frewsxcv:path-cleanup, r=alexcrichton
None
2 parents 0913004 + c82be2f commit cefbe50

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/libstd/path.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ mod platform {
226226
}
227227
_ => (),
228228
}
229-
} else if path.len() > 1 && path[1] == b':' {
229+
} else if path.get(1) == Some(b':') {
230230
// C:
231231
let c = path[0];
232232
if c.is_ascii() && (c as char).is_alphabetic() {
@@ -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)