Rollback prefix
This commit is contained in:
parent
729442206c
commit
056ebccee3
|
@ -136,9 +136,7 @@ use sys::path::{is_sep_byte, is_verbatim_sep, MAIN_SEP_STR, parse_prefix};
|
|||
// Windows Prefixes
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/// Path prefixes (Redox and Windows only).
|
||||
///
|
||||
/// Redox uses schemes like `scheme:reference` to identify different I/O systems
|
||||
/// Path prefixes (Windows only).
|
||||
///
|
||||
/// Windows uses a variety of path styles, including references to drive
|
||||
/// volumes (like `C:`), network shared folders (like `\\server\share`) and
|
||||
|
@ -187,9 +185,6 @@ impl<'a> Prefix<'a> {
|
|||
os_str_as_u8_slice(s).len()
|
||||
}
|
||||
match *self {
|
||||
#[cfg(target_os = "redox")]
|
||||
Verbatim(x) => 1 + os_str_len(x),
|
||||
#[cfg(not(target_os = "redox"))]
|
||||
Verbatim(x) => 4 + os_str_len(x),
|
||||
VerbatimUNC(x, y) => {
|
||||
8 + os_str_len(x) +
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use path::Prefix;
|
||||
use ffi::OsStr;
|
||||
|
||||
#[inline]
|
||||
|
@ -23,8 +22,9 @@ pub fn is_verbatim_sep(b: u8) -> bool {
|
|||
|
||||
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::Verbatim(OsStr::new(&path_str[..i])))
|
||||
if let Some(_i) = path_str.find(':') {
|
||||
//TODO: Redox specific prefix Some(Prefix::Verbatim(OsStr::new(&path_str[..i])))
|
||||
None
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue