about summary refs log tree commit diff
path: root/library/std/src/os/unix/net/addr.rs
diff options
context:
space:
mode:
authorthe8472 <the8472@users.noreply.github.com>2021-10-12 14:53:08 +0200
committerGitHub <noreply@github.com>2021-10-12 14:53:08 +0200
commitb55a3c5d150b64fbd878109d9428ac8edc9cd68b (patch)
treeb66f3844aaadbdec21a97327ee30ef24dce65e65 /library/std/src/os/unix/net/addr.rs
parent9475e609b8458fff9e444934a6017d2e590642cf (diff)
parent06e625f7d582601f5e2ff69ba80f6d3a11632b24 (diff)
downloadrust-b55a3c5d150b64fbd878109d9428ac8edc9cd68b.tar.gz
rust-b55a3c5d150b64fbd878109d9428ac8edc9cd68b.zip
Rollup merge of #89778 - jkugelman:must-use-as_type-conversions, r=joshtriplett
Add #[must_use] to as_type conversions

Clippy missed these:

```rust
alloc::string::String   fn as_mut_str(&mut self) -> &mut str;
core::mem::NonNull<T>   unsafe fn as_uninit_mut<'a>(&mut self) -> &'a MaybeUninit<T>;
str                     unsafe fn as_bytes_mut(&mut self) -> &mut [u8];
str                     fn as_mut_ptr(&mut self) -> *mut u8;
```

Parent issue: #89692

r? ````@joshtriplett````
Diffstat (limited to 'library/std/src/os/unix/net/addr.rs')
-rw-r--r--library/std/src/os/unix/net/addr.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/library/std/src/os/unix/net/addr.rs b/library/std/src/os/unix/net/addr.rs
index 62bfde8bfd4..d741096893a 100644
--- a/library/std/src/os/unix/net/addr.rs
+++ b/library/std/src/os/unix/net/addr.rs
@@ -192,6 +192,7 @@ impl SocketAddr {
     /// }
     /// ```
     #[stable(feature = "unix_socket", since = "1.10.0")]
+    #[must_use]
     pub fn as_pathname(&self) -> Option<&Path> {
         if let AddressKind::Pathname(path) = self.address() { Some(path) } else { None }
     }