Skip to content

Commit

Permalink
suggest &str
Browse files Browse the repository at this point in the history
  • Loading branch information
nyurik committed Sep 28, 2024
1 parent 38295a0 commit 10e02cf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions clippy_lints/src/functions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down

0 comments on commit 10e02cf

Please sign in to comment.