]> git.lizzy.rs Git - rust.git/blobdiff - library/std/src/ffi/os_str.rs
Rollup merge of #89786 - jkugelman:must-use-len-and-is_empty, r=joshtriplett
[rust.git] / library / std / src / ffi / os_str.rs
index 49e268eb99bc85c503e1e5b17dbd83afa638b1ab..d7587e85c66841dc71e07144fb54dafba32808f8 100644 (file)
@@ -669,6 +669,7 @@ pub fn to_os_string(&self) -> OsString {
     /// assert!(!os_str.is_empty());
     /// ```
     #[stable(feature = "osstring_simple_functions", since = "1.9.0")]
+    #[must_use]
     #[inline]
     pub fn is_empty(&self) -> bool {
         self.inner.inner.is_empty()
@@ -700,6 +701,7 @@ pub fn is_empty(&self) -> bool {
     /// assert_eq!(os_str.len(), 3);
     /// ```
     #[stable(feature = "osstring_simple_functions", since = "1.9.0")]
+    #[must_use]
     #[inline]
     pub fn len(&self) -> usize {
         self.inner.inner.len()