Skip to content

Commit 92ae54c

Browse files
committed
Move the is_empty method to Path instead
1 parent 64aea50 commit 92ae54c

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

src/libstd/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@
234234
#![feature(const_fn)]
235235
#![feature(core_float)]
236236
#![feature(core_intrinsics)]
237+
#![feature(convert)]
237238
#![feature(decode_utf16)]
238239
#![feature(drop_in_place)]
239240
#![feature(dropck_parametricity)]

src/libstd/path.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,15 +1147,6 @@ impl PathBuf {
11471147
self.inner
11481148
}
11491149

1150-
/// Checks if the path buffer is empty. On Windows, it will return false if the inner string is
1151-
/// invalid unicode. On Unix, this is a no-op.
1152-
pub fn is_empty(&self) -> bool {
1153-
if let Some(b) = self.inner.to_bytes() {
1154-
b.is_empty()
1155-
} else {
1156-
true
1157-
}
1158-
}
11591150
}
11601151

11611152
#[stable(feature = "rust1", since = "1.0.0")]
@@ -1869,6 +1860,17 @@ impl Path {
18691860
pub fn is_dir(&self) -> bool {
18701861
fs::metadata(self).map(|m| m.is_dir()).unwrap_or(false)
18711862
}
1863+
1864+
/// Checks if the path buffer is empty. On Windows, it will return false if the inner string is
1865+
/// invalid unicode. On Unix, this is a no-op.
1866+
#[unstable(feature = "path_extras", reason = "recently added", issue = "30259")]
1867+
pub fn is_empty(&self) -> bool {
1868+
if let Some(b) = self.inner.to_bytes() {
1869+
b.is_empty()
1870+
} else {
1871+
true
1872+
}
1873+
}
18721874
}
18731875

18741876
#[stable(feature = "rust1", since = "1.0.0")]

0 commit comments

Comments
 (0)