Skip to content

Commit 10e02cf

Browse files
committed
suggest &str
1 parent 38295a0 commit 10e02cf

File tree

1 file changed

+4
-2
lines changed
  • clippy_lints/src/functions

1 file changed

+4
-2
lines changed

clippy_lints/src/functions/mod.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -432,8 +432,10 @@ declare_clippy_lint! {
432432
/// ```
433433
/// Use instead:
434434
/// ```no_run
435-
/// // caller should use foo(opt.as_ref())
436-
/// fn foo(a: Option<&String>) {}
435+
/// // caller should use `foo1(opt.as_ref())`
436+
/// fn foo1(a: Option<&String>) {}
437+
/// // better yet, use string slice `foo2(opt.as_deref())`
438+
/// fn foo2(a: Option<&str>) {}
437439
/// # struct Unit {}
438440
/// # impl Unit {
439441
/// fn bar(&self) -> Option<&String> { None }

0 commit comments

Comments
 (0)