Skip to content

Commit 2ec2132

Browse files
committed
Switch to using Prefix::Verbatim
1 parent 746222f commit 2ec2132

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/libstd/path.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,6 @@ use sys::path::{is_sep_byte, is_verbatim_sep, MAIN_SEP_STR, parse_prefix};
148148
#[derive(Copy, Clone, Debug, Hash, PartialOrd, Ord, PartialEq, Eq)]
149149
#[stable(feature = "rust1", since = "1.0.0")]
150150
pub enum Prefix<'a> {
151-
/// Prefix `scheme:`, where `scheme` is the component stored
152-
#[unstable(feature="redox_prefix", issue="0")]
153-
Scheme(&'a OsStr),
154-
155151
/// Prefix `\\?\`, together with the given component immediately following it.
156152
#[stable(feature = "rust1", since = "1.0.0")]
157153
Verbatim(#[stable(feature = "rust1", since = "1.0.0")] &'a OsStr),
@@ -191,7 +187,9 @@ impl<'a> Prefix<'a> {
191187
os_str_as_u8_slice(s).len()
192188
}
193189
match *self {
194-
Scheme(x) => os_str_len(x) + 1,
190+
#[cfg(target_os = "redox")]
191+
Verbatim(x) => 1 + os_str_len(x),
192+
#[cfg(not(target_os = "redox"))]
195193
Verbatim(x) => 4 + os_str_len(x),
196194
VerbatimUNC(x, y) => {
197195
8 + os_str_len(x) +

src/libstd/sys/redox/path.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub fn is_verbatim_sep(b: u8) -> bool {
2424
pub fn parse_prefix(path: &OsStr) -> Option<Prefix> {
2525
if let Some(path_str) = path.to_str() {
2626
if let Some(i) = path_str.find(':') {
27-
Some(Prefix::Scheme(OsStr::new(&path_str[..i])))
27+
Some(Prefix::Verbatim(OsStr::new(&path_str[..i])))
2828
} else {
2929
None
3030
}

0 commit comments

Comments
 (0)