1
Fork 0

Prefer slice::get over length check with indexing.

This commit is contained in:
Corey Farwell 2016-02-24 22:34:23 -05:00
parent 0ef8d42605
commit 8adc3f74f5

View file

@ -226,7 +226,7 @@ mod platform {
} }
_ => (), _ => (),
} }
} else if path.len() > 1 && path[1] == b':' { } else if path.get(1) == Some(b':') {
// C: // C:
let c = path[0]; let c = path[0];
if c.is_ascii() && (c as char).is_alphabetic() { if c.is_ascii() && (c as char).is_alphabetic() {