diff options
Diffstat (limited to 'src/libstd/sys')
| -rw-r--r-- | src/libstd/sys/redox/path.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/libstd/sys/redox/path.rs b/src/libstd/sys/redox/path.rs index bf9af7a4353..4069a0ea726 100644 --- a/src/libstd/sys/redox/path.rs +++ b/src/libstd/sys/redox/path.rs @@ -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 = "/"; |
