Allow absolute if either contains root or a scheme
This commit is contained in:
parent
12e6b53744
commit
ef76ebf28c
1 changed files with 4 additions and 4 deletions
|
@ -1691,11 +1691,11 @@ impl Path {
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[allow(deprecated)]
|
#[allow(deprecated)]
|
||||||
pub fn is_absolute(&self) -> bool {
|
pub fn is_absolute(&self) -> bool {
|
||||||
if !cfg!(target_os = "redox") {
|
if cfg!(target_os = "redox") {
|
||||||
self.has_root() && (cfg!(unix) || self.prefix().is_some())
|
|
||||||
} else {
|
|
||||||
// FIXME: Allow Redox prefixes
|
// FIXME: Allow Redox prefixes
|
||||||
has_redox_scheme(self.as_u8_slice())
|
self.has_root() || has_redox_scheme(self.as_u8_slice())
|
||||||
|
} else {
|
||||||
|
self.has_root() && (cfg!(unix) || self.prefix().is_some())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue