Skip to content

Commit 565400d

Browse files
committed
Add clippy_utils::paths imports
1 parent 0743e84 commit 565400d

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

clippy_lints/src/assign_ops.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use clippy_utils::diagnostics::span_lint_and_then;
22
use clippy_utils::source::snippet_opt;
33
use clippy_utils::ty::implements_trait;
44
use clippy_utils::{eq_expr_value, get_trait_def_id, trait_ref_of_method};
5-
use clippy_utils::{higher, sugg};
5+
use clippy_utils::{higher, paths, sugg};
66
use if_chain::if_chain;
77
use rustc_errors::Applicability;
88
use rustc_hir as hir;
@@ -93,7 +93,7 @@ impl<'tcx> LateLintPass<'tcx> for AssignOps {
9393
$($trait_name:ident),+) => {
9494
match $op {
9595
$(hir::BinOpKind::$trait_name => {
96-
let [krate, module] = clippy_utils::paths::OPS_MODULE;
96+
let [krate, module] = paths::OPS_MODULE;
9797
let path: [&str; 3] = [krate, module, concat!(stringify!($trait_name), "Assign")];
9898
let trait_id = if let Some(trait_id) = get_trait_def_id($cx, &path) {
9999
trait_id

clippy_lints/src/manual_unwrap_or.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use clippy_utils::diagnostics::span_lint_and_sugg;
33
use clippy_utils::source::{indent_of, reindent_multiline, snippet_opt};
44
use clippy_utils::ty::is_type_diagnostic_item;
55
use clippy_utils::usage::contains_return_break_continue_macro;
6-
use clippy_utils::{in_constant, match_qpath, path_to_local_id, sugg};
6+
use clippy_utils::{in_constant, match_qpath, path_to_local_id, paths, sugg};
77
use if_chain::if_chain;
88
use rustc_errors::Applicability;
99
use rustc_hir::{Arm, Expr, ExprKind, Pat, PatKind};
@@ -75,16 +75,16 @@ fn lint_manual_unwrap_or<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) {
7575
if let Some((idx, or_arm)) = arms.iter().enumerate().find(|(_, arm)|
7676
match arm.pat.kind {
7777
PatKind::Path(ref some_qpath) =>
78-
match_qpath(some_qpath, &clippy_utils::paths::OPTION_NONE),
78+
match_qpath(some_qpath, &paths::OPTION_NONE),
7979
PatKind::TupleStruct(ref err_qpath, &[Pat { kind: PatKind::Wild, .. }], _) =>
80-
match_qpath(err_qpath, &clippy_utils::paths::RESULT_ERR),
80+
match_qpath(err_qpath, &paths::RESULT_ERR),
8181
_ => false,
8282
}
8383
);
8484
let unwrap_arm = &arms[1 - idx];
8585
if let PatKind::TupleStruct(ref unwrap_qpath, &[unwrap_pat], _) = unwrap_arm.pat.kind;
86-
if match_qpath(unwrap_qpath, &clippy_utils::paths::OPTION_SOME)
87-
|| match_qpath(unwrap_qpath, &clippy_utils::paths::RESULT_OK);
86+
if match_qpath(unwrap_qpath, &paths::OPTION_SOME)
87+
|| match_qpath(unwrap_qpath, &paths::RESULT_OK);
8888
if let PatKind::Binding(_, binding_hir_id, ..) = unwrap_pat.kind;
8989
if path_to_local_id(unwrap_arm.body, binding_hir_id);
9090
if !contains_return_break_continue_macro(or_arm.body);

clippy_lints/src/suspicious_trait_impl.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use clippy_utils::diagnostics::span_lint;
2-
use clippy_utils::{get_trait_def_id, trait_ref_of_method};
2+
use clippy_utils::{get_trait_def_id, paths, trait_ref_of_method};
33
use if_chain::if_chain;
44
use rustc_hir as hir;
55
use rustc_hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
@@ -159,7 +159,7 @@ fn check_binop(
159159
expected_ops: &[hir::BinOpKind],
160160
) -> Option<&'static str> {
161161
let mut trait_ids = vec![];
162-
let [krate, module] = clippy_utils::paths::OPS_MODULE;
162+
let [krate, module] = paths::OPS_MODULE;
163163

164164
for &t in traits {
165165
let path = [krate, module, t];

0 commit comments

Comments
 (0)