]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/needless_pass_by_value.rs
More diagnostic items
[rust.git] / clippy_lints / src / needless_pass_by_value.rs
index 28650c88b4800b8516fde049c8d83510289ef7f7..4be127394e709c940d5d4bd1ac75edbd3fa14040 100644 (file)
@@ -1,6 +1,6 @@
 use crate::utils::ptr::get_spans;
 use crate::utils::{
-    get_trait_def_id, implements_trait, is_copy, is_self, is_type_diagnostic_item, match_type, multispan_sugg, paths,
+    get_trait_def_id, implements_trait, is_copy, is_self, is_type_diagnostic_item, multispan_sugg, paths,
     snippet, snippet_opt, span_lint_and_then,
 };
 use if_chain::if_chain;
@@ -254,7 +254,7 @@ fn check_fn(
                             }
                         }
 
-                        if match_type(cx, ty, &paths::STRING) {
+                        if is_type_diagnostic_item(cx, ty, sym!(string_type)) {
                             if let Some(clone_spans) =
                                 get_spans(cx, Some(body.id()), idx, &[("clone", ".to_string()"), ("as_str", "")]) {
                                 diag.span_suggestion(