Skip to content

Commit e1b3f85

Browse files
author
Frank
committed
run cargo dev fmt
1 parent f4d88cb commit e1b3f85

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

clippy_lints/src/disallowed_method.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use crate::utils::span_lint;
22

33
use rustc_data_structures::fx::FxHashSet;
4-
use rustc_lint::{LateLintPass, LateContext};
5-
use rustc_session::{impl_lint_pass, declare_tool_lint};
64
use rustc_hir::*;
5+
use rustc_lint::{LateContext, LateLintPass};
6+
use rustc_session::{declare_tool_lint, impl_lint_pass};
77
use rustc_span::Symbol;
88

99
declare_clippy_lint! {
@@ -38,18 +38,17 @@ pub struct DisallowedMethod {
3838
impl DisallowedMethod {
3939
pub fn new(disallowed: FxHashSet<String>) -> Self {
4040
Self {
41-
disallowed: disallowed.iter()
42-
.map(|s| {
43-
s.split("::").map(|seg| Symbol::intern(seg)).collect::<Vec<_>>()
44-
})
41+
disallowed: disallowed
42+
.iter()
43+
.map(|s| s.split("::").map(|seg| Symbol::intern(seg)).collect::<Vec<_>>())
4544
.collect(),
4645
}
4746
}
4847
}
4948

5049
impl_lint_pass!(DisallowedMethod => [DISALLOWED_METHOD]);
5150

52-
impl <'tcx> LateLintPass<'tcx> for DisallowedMethod {
51+
impl<'tcx> LateLintPass<'tcx> for DisallowedMethod {
5352
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
5453
if let ExprKind::MethodCall(_path, _, _args, _) = &expr.kind {
5554
let def_id = cx.typeck_results().type_dependent_def_id(expr.hir_id).unwrap();
@@ -67,7 +66,7 @@ impl <'tcx> LateLintPass<'tcx> for DisallowedMethod {
6766
.map(|s| s.to_ident_string())
6867
.collect::<Vec<_>>()
6968
.join("::"),
70-
)
69+
),
7170
);
7271
}
7372
}

tests/ui/disallowed_method.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ fn main() {
4242
let f = Foo;
4343
let c = ImplStruct;
4444
let n = NormalStruct;
45-
let a = AttrStruct{ bad_method: 5 };
45+
let a = AttrStruct { bad_method: 5 };
4646

4747
// lint these
4848
b.bad_method();

0 commit comments

Comments
 (0)