]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/repeat_once.rs
Rollup merge of #75180 - KodrAus:feat/error-by-ref, r=m-ou-se
[rust.git] / src / tools / clippy / clippy_lints / src / repeat_once.rs
index ae6013530091e23716caadc26a3bc0df5144be44..d34e744eb944cd0631f0bc00b6d55ffdc6b6585c 100644 (file)
@@ -5,6 +5,7 @@
 use rustc_hir::{Expr, ExprKind};
 use rustc_lint::{LateContext, LateLintPass};
 use rustc_session::{declare_lint_pass, declare_tool_lint};
+use rustc_span::sym;
 
 declare_clippy_lint! {
     /// **What it does:** Checks for usage of `.repeat(1)` and suggest the following method for each types.
@@ -65,7 +66,7 @@ fn check_expr(&mut self, cx: &LateContext<'_>, expr: &'tcx Expr<'_>) {
                         format!("{}.to_vec()", snippet(cx, receiver.span, r#""...""#)),
                         Applicability::MachineApplicable,
                     );
-                } else if is_type_diagnostic_item(cx, ty, sym!(string_type)) {
+                } else if is_type_diagnostic_item(cx, ty, sym::string_type) {
                     span_lint_and_sugg(
                         cx,
                         REPEAT_ONCE,