We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a503c80 commit 64aea50Copy full SHA for 64aea50
src/libstd/path.rs
@@ -1146,6 +1146,16 @@ impl PathBuf {
1146
pub fn into_os_string(self) -> OsString {
1147
self.inner
1148
}
1149
+
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
1159
1160
1161
#[stable(feature = "rust1", since = "1.0.0")]
0 commit comments