File tree 2 files changed +7
-6
lines changed
2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -283,6 +283,11 @@ impl OsStr {
283
283
self . to_bytes ( ) . and_then ( |b| CString :: new ( b) . ok ( ) )
284
284
}
285
285
286
+ #[ unstable( feature = "os_extras" , reason = "recently added" ) ]
287
+ pub fn is_empty ( & self ) -> bool {
288
+ self . inner . inner . is_empty ( )
289
+ }
290
+
286
291
/// Gets the underlying byte representation.
287
292
///
288
293
/// Note: it is *crucial* that this API is private, to avoid
Original file line number Diff line number Diff line change @@ -1873,13 +1873,9 @@ impl Path {
1873
1873
///
1874
1874
/// assert!(!path.is_empty());
1875
1875
/// ```
1876
- #[ unstable( feature = "path_extras " , reason = "recently added" , issue = "30259" ) ]
1876
+ #[ unstable( feature = "os_extras " , reason = "recently added" , issue = "30259" ) ]
1877
1877
pub fn is_empty ( & self ) -> bool {
1878
- if let Some ( b) = self . inner . to_bytes ( ) {
1879
- b. is_empty ( )
1880
- } else {
1881
- true
1882
- }
1878
+ self . inner . is_empty ( )
1883
1879
}
1884
1880
}
1885
1881
You can’t perform that action at this time.
0 commit comments