about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYuri Astrakhan <YuriAstrakhan@gmail.com>2024-09-28 13:17:29 -0400
committerYuri Astrakhan <YuriAstrakhan@gmail.com>2024-09-28 13:17:29 -0400
commit10e02cf8e3e8b46d3bc7f8194c9224755604eac4 (patch)
tree27ce7c61fc6a2866be9909c2249263aedc84a423
parent38295a0d8acf04a55567cbc1bfa3eddd45e5e702 (diff)
downloadrust-10e02cf8e3e8b46d3bc7f8194c9224755604eac4.tar.gz
rust-10e02cf8e3e8b46d3bc7f8194c9224755604eac4.zip
suggest &str
-rw-r--r--clippy_lints/src/functions/mod.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/clippy_lints/src/functions/mod.rs b/clippy_lints/src/functions/mod.rs
index 50b3d039ed3..203c3ce9eec 100644
--- a/clippy_lints/src/functions/mod.rs
+++ b/clippy_lints/src/functions/mod.rs
@@ -432,8 +432,10 @@ declare_clippy_lint! {
     /// ```
     /// Use instead:
     /// ```no_run
-    /// // caller should use  foo(opt.as_ref())
-    /// fn foo(a: Option<&String>) {}
+    /// // caller should use  `foo1(opt.as_ref())`
+    /// fn foo1(a: Option<&String>) {}
+    /// // better yet, use string slice  `foo2(opt.as_deref())`
+    /// fn foo2(a: Option<&str>) {}
     /// # struct Unit {}
     /// # impl Unit {
     /// fn bar(&self) -> Option<&String> { None }