about summary refs log tree commit diff
path: root/library/alloc/src/string.rs
diff options
context:
space:
mode:
authorGnomedDev <david2005thomas@gmail.com>2024-09-18 21:09:06 +0100
committerGnomedDev <david2005thomas@gmail.com>2024-09-19 13:13:19 +0100
commit5e4716888a731cdd929bdbaf94eeb3e192f1eace (patch)
tree6977e3dda2c063307f24241ad5136d7b8cb8a62b /library/alloc/src/string.rs
parent3ebff28f80cbbe5b51dd3d0edf8e5d0a8db1233f (diff)
downloadrust-5e4716888a731cdd929bdbaf94eeb3e192f1eace.tar.gz
rust-5e4716888a731cdd929bdbaf94eeb3e192f1eace.zip
[Clippy] Swap `option_as_ref_deref` to use diagnostic items instead of paths
Diffstat (limited to 'library/alloc/src/string.rs')
-rw-r--r--library/alloc/src/string.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs
index 6daab5bc73a..a2c70de3ed0 100644
--- a/library/alloc/src/string.rs
+++ b/library/alloc/src/string.rs
@@ -1073,6 +1073,7 @@ impl String {
     #[inline]
     #[must_use]
     #[stable(feature = "string_as_str", since = "1.7.0")]
+    #[cfg_attr(not(test), rustc_diagnostic_item = "string_as_str")]
     pub fn as_str(&self) -> &str {
         self
     }
@@ -1092,6 +1093,7 @@ impl String {
     #[inline]
     #[must_use]
     #[stable(feature = "string_as_str", since = "1.7.0")]
+    #[cfg_attr(not(test), rustc_diagnostic_item = "string_as_mut_str")]
     pub fn as_mut_str(&mut self) -> &mut str {
         self
     }