Fix redox prefix handling
This commit is contained in:
parent
a0b5dfef2a
commit
18bf0540bf
2 changed files with 18 additions and 3 deletions
|
|
@ -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 = "/";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue