Skip to content

Commit

Permalink
Prefer slice::get over length check with indexing.
Browse files Browse the repository at this point in the history
  • Loading branch information
frewsxcv committed Feb 25, 2016
1 parent 0ef8d42 commit 8adc3f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libstd/path.rs
Expand Up @@ -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() {
Expand Down

0 comments on commit 8adc3f7

Please sign in to comment.