Fix redox prefix handling

This commit is contained in:
Jeremy Soller 2016-11-14 15:02:18 -07:00
parent a0b5dfef2a
commit 18bf0540bf
2 changed files with 18 additions and 3 deletions

View file

@ -21,8 +21,16 @@ pub fn is_verbatim_sep(b: u8) -> bool {
b == b'/'
}
pub fn parse_prefix(_: &OsStr) -> Option<Prefix> {
None
pub fn parse_prefix(path: &OsStr) -> Option<Prefix> {
if let Some(path_str) = path.to_str() {
if let Some(i) = path_str.find(':') {
Some(Prefix::Scheme(OsStr::new(&path_str[..i])))
} else {
None
}
} else {
None
}
}
pub const MAIN_SEP_STR: &'static str = "/";