diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2016-02-26 15:12:17 +0530 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2016-02-26 17:03:39 +0530 |
| commit | cefbe505bd350a324f44679c2ab51dfa12b2ef34 (patch) | |
| tree | 6e7850fd96a8ec7a52f5abc9edc5b4cb9436a5c9 /src/libstd | |
| parent | 09130044ce7429beb95742afa7fd371960dbe607 (diff) | |
| parent | c82be2f4cb909a70b870ab2fb176e54a91e5372f (diff) | |
| download | rust-cefbe505bd350a324f44679c2ab51dfa12b2ef34.tar.gz rust-cefbe505bd350a324f44679c2ab51dfa12b2ef34.zip | |
Rollup merge of #31878 - frewsxcv:path-cleanup, r=alexcrichton
None
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/path.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/libstd/path.rs b/src/libstd/path.rs index 35118bde96b..81d9d0a7f10 100644 --- a/src/libstd/path.rs +++ b/src/libstd/path.rs @@ -226,7 +226,7 @@ mod platform { } _ => (), } - } else if path.len() > 1 && path[1] == b':' { + } else if path.get(1) == Some(b':') { // C: let c = path[0]; 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> loop { let mut iter_next = iter.clone(); match (iter_next.next(), prefix.next()) { - (Some(x), Some(y)) => { - if x != y { - return None; - } - } + (Some(ref x), Some(ref y)) if x == y => (), + (Some(_), Some(_)) => return None, (Some(_), None) => return Some(iter), (None, None) => return Some(iter), (None, Some(_)) => return None, |
