File tree 2 files changed +7
-3
lines changed
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -191,6 +191,10 @@ pub enum Prefix<'a> {
191
191
/// Prefix `C:` for the given disk drive.
192
192
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
193
193
Disk ( #[ stable( feature = "rust1" , since = "1.0.0" ) ] u8 ) ,
194
+
195
+ /// Scheme `file:` used on Redox
196
+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
197
+ Scheme ( #[ stable( feature = "rust1" , since = "1.0.0" ) ] & ' a OsStr ) ,
194
198
}
195
199
196
200
impl < ' a > Prefix < ' a > {
@@ -221,6 +225,7 @@ impl<'a> Prefix<'a> {
221
225
} ,
222
226
DeviceNS ( x) => 4 + os_str_len ( x) ,
223
227
Disk ( _) => 2 ,
228
+ Scheme ( x) => 1 + os_str_len ( x) ,
224
229
}
225
230
226
231
}
Original file line number Diff line number Diff line change @@ -23,10 +23,9 @@ pub fn is_verbatim_sep(b: u8) -> bool {
23
23
24
24
pub fn parse_prefix ( path : & OsStr ) -> Option < Prefix > {
25
25
if let Some ( path_str) = path. to_str ( ) {
26
- if let Some ( _i ) = path_str. find ( ':' ) {
26
+ if let Some ( i ) = path_str. find ( ':' ) {
27
27
// FIXME: Redox specific prefix
28
- // Some(Prefix::Verbatim(OsStr::new(&path_str[..i])))
29
- None
28
+ Some ( Prefix :: Scheme ( OsStr :: new ( & path_str[ ..i] ) ) )
30
29
} else {
31
30
None
32
31
}
You can’t perform that action at this time.
0 commit comments