We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
is_clone_like
1 parent 3beb6b1 commit b891389Copy full SHA for b891389
1 file changed
clippy_lints/src/methods/implicit_clone.rs
@@ -32,6 +32,9 @@ pub fn check(cx: &LateContext<'_>, method_name: &str, expr: &hir::Expr<'_>, recv
32
}
33
34
/// Returns true if the named method can be used to clone the receiver.
35
+/// Note that `to_string` is not flagged by `implicit_clone`. So other lints that call
36
+/// `is_clone_like` and that do flag `to_string` must handle it separately. See, e.g.,
37
+/// `is_to_owned_like` in `unnecessary_to_owned.rs`.
38
pub fn is_clone_like(cx: &LateContext<'_>, method_name: &str, method_def_id: hir::def_id::DefId) -> bool {
39
match method_name {
40
"to_os_string" => is_diag_item_method(cx, method_def_id, sym::OsStr),
0 commit comments