diff options
| author | Jeremy Soller <jackpot51@gmail.com> | 2016-11-28 18:19:17 -0700 |
|---|---|---|
| committer | Jeremy Soller <jackpot51@gmail.com> | 2016-11-28 18:19:17 -0700 |
| commit | 2ec21327f25e4646ce64a2e331bb4702cf96dc99 (patch) | |
| tree | 2acb36e4e60168b8da8da54d445a2d9daf96ab09 | |
| parent | 746222fd9d6c16d3dc3c44c797dcc868297c133b (diff) | |
| download | rust-2ec21327f25e4646ce64a2e331bb4702cf96dc99.tar.gz rust-2ec21327f25e4646ce64a2e331bb4702cf96dc99.zip | |
Switch to using Prefix::Verbatim
| -rw-r--r-- | src/libstd/path.rs | 8 | ||||
| -rw-r--r-- | src/libstd/sys/redox/path.rs | 2 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/libstd/path.rs b/src/libstd/path.rs index 8bf9bbb1320..e38cff179c3 100644 --- a/src/libstd/path.rs +++ b/src/libstd/path.rs @@ -148,10 +148,6 @@ use sys::path::{is_sep_byte, is_verbatim_sep, MAIN_SEP_STR, parse_prefix}; #[derive(Copy, Clone, Debug, Hash, PartialOrd, Ord, PartialEq, Eq)] #[stable(feature = "rust1", since = "1.0.0")] pub enum Prefix<'a> { - /// Prefix `scheme:`, where `scheme` is the component stored - #[unstable(feature="redox_prefix", issue="0")] - Scheme(&'a OsStr), - /// Prefix `\\?\`, together with the given component immediately following it. #[stable(feature = "rust1", since = "1.0.0")] Verbatim(#[stable(feature = "rust1", since = "1.0.0")] &'a OsStr), @@ -191,7 +187,9 @@ impl<'a> Prefix<'a> { os_str_as_u8_slice(s).len() } match *self { - Scheme(x) => os_str_len(x) + 1, + #[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) + diff --git a/src/libstd/sys/redox/path.rs b/src/libstd/sys/redox/path.rs index 4069a0ea726..e609f83bc07 100644 --- a/src/libstd/sys/redox/path.rs +++ b/src/libstd/sys/redox/path.rs @@ -24,7 +24,7 @@ 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::Scheme(OsStr::new(&path_str[..i]))) + Some(Prefix::Verbatim(OsStr::new(&path_str[..i]))) } else { None } |
