suggest &str

This commit is contained in:
Yuri Astrakhan 2024-09-28 13:17:29 -04:00
parent 38295a0d8a
commit 10e02cf8e3

View File

@ -432,8 +432,10 @@ declare_clippy_lint! {
/// ``` /// ```
/// Use instead: /// Use instead:
/// ```no_run /// ```no_run
/// // caller should use foo(opt.as_ref()) /// // caller should use `foo1(opt.as_ref())`
/// fn foo(a: Option<&String>) {} /// fn foo1(a: Option<&String>) {}
/// // better yet, use string slice `foo2(opt.as_deref())`
/// fn foo2(a: Option<&str>) {}
/// # struct Unit {} /// # struct Unit {}
/// # impl Unit { /// # impl Unit {
/// fn bar(&self) -> Option<&String> { None } /// fn bar(&self) -> Option<&String> { None }