Skip to content

Commit ba12494

Browse files
committed
cargo dev fmt
1 parent e90b977 commit ba12494

File tree

9 files changed

+26
-13
lines changed

9 files changed

+26
-13
lines changed

clippy_lints/src/doc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ fn check_code(cx: &LateContext<'_>, text: &str, span: Span) {
480480
| ItemKind::ForeignMod(..) => return false,
481481
// We found a main function ...
482482
ItemKind::Fn(_, sig, _, Some(block)) if item.ident.name == sym::main => {
483-
let is_async = matches!(sig.header.asyncness, Async::Yes{..});
483+
let is_async = matches!(sig.header.asyncness, Async::Yes { .. });
484484
let returns_nothing = match &sig.decl.output {
485485
FnRetTy::Default(..) => true,
486486
FnRetTy::Ty(ty) if ty.kind.is_unit() => true,

clippy_lints/src/missing_const_for_fn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingConstForFn {
9999
let has_const_generic_params = generics
100100
.params
101101
.iter()
102-
.any(|param| matches!(param.kind, GenericParamKind::Const{ .. }));
102+
.any(|param| matches!(param.kind, GenericParamKind::Const { .. }));
103103

104104
if already_const(header) || has_const_generic_params {
105105
return;

clippy_lints/src/needless_pass_by_value.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,10 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessPassByValue {
9090

9191
// Exclude non-inherent impls
9292
if let Some(Node::Item(item)) = cx.tcx.hir().find(cx.tcx.hir().get_parent_node(hir_id)) {
93-
if matches!(item.kind, ItemKind::Impl{ of_trait: Some(_), .. } |
94-
ItemKind::Trait(..))
95-
{
93+
if matches!(
94+
item.kind,
95+
ItemKind::Impl { of_trait: Some(_), .. } | ItemKind::Trait(..)
96+
) {
9697
return;
9798
}
9899
}

clippy_lints/src/pass_by_ref_or_value.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,10 @@ impl<'tcx> LateLintPass<'tcx> for PassByRefOrValue {
244244

245245
// Exclude non-inherent impls
246246
if let Some(Node::Item(item)) = cx.tcx.hir().find(cx.tcx.hir().get_parent_node(hir_id)) {
247-
if matches!(item.kind, ItemKind::Impl{ of_trait: Some(_), .. } |
248-
ItemKind::Trait(..))
249-
{
247+
if matches!(
248+
item.kind,
249+
ItemKind::Impl { of_trait: Some(_), .. } | ItemKind::Trait(..)
250+
) {
250251
return;
251252
}
252253
}

clippy_lints/src/redundant_clone.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,10 @@ impl<'tcx> mir::visit::Visitor<'tcx> for LocalUseVisitor {
390390
let local = place.local;
391391

392392
if local == self.used.0
393-
&& !matches!(ctx, PlaceContext::MutatingUse(MutatingUseContext::Drop) | PlaceContext::NonUse(_))
393+
&& !matches!(
394+
ctx,
395+
PlaceContext::MutatingUse(MutatingUseContext::Drop) | PlaceContext::NonUse(_)
396+
)
394397
{
395398
self.used.1 = true;
396399
}

clippy_lints/src/types.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,9 @@ fn is_empty_block(expr: &Expr<'_>) -> bool {
11041104
expr.kind,
11051105
ExprKind::Block(
11061106
Block {
1107-
stmts: &[], expr: None, ..
1107+
stmts: &[],
1108+
expr: None,
1109+
..
11081110
},
11091111
_,
11101112
)

clippy_lints/src/unnecessary_wraps.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ impl<'tcx> LateLintPass<'tcx> for UnnecessaryWraps {
7474
}
7575

7676
if let Some(Node::Item(item)) = cx.tcx.hir().find(cx.tcx.hir().get_parent_node(hir_id)) {
77-
if matches!(item.kind, ItemKind::Impl{ of_trait: Some(_), ..} | ItemKind::Trait(..)) {
77+
if matches!(
78+
item.kind,
79+
ItemKind::Impl { of_trait: Some(_), .. } | ItemKind::Trait(..)
80+
) {
7881
return;
7982
}
8083
}

clippy_lints/src/utils/ast_utils.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,10 @@ pub fn eq_use_tree_kind(l: &UseTreeKind, r: &UseTreeKind) -> bool {
408408
}
409409

410410
pub fn eq_defaultness(l: Defaultness, r: Defaultness) -> bool {
411-
matches!((l, r), (Defaultness::Final, Defaultness::Final) | (Defaultness::Default(_), Defaultness::Default(_)))
411+
matches!(
412+
(l, r),
413+
(Defaultness::Final, Defaultness::Final) | (Defaultness::Default(_), Defaultness::Default(_))
414+
)
412415
}
413416

414417
pub fn eq_vis(l: &Visibility, r: &Visibility) -> bool {

clippy_lints/src/utils/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1500,7 +1500,7 @@ pub fn is_no_std_crate(krate: &Crate<'_>) -> bool {
15001500
/// ```
15011501
pub fn is_trait_impl_item(cx: &LateContext<'_>, hir_id: HirId) -> bool {
15021502
if let Some(Node::Item(item)) = cx.tcx.hir().find(cx.tcx.hir().get_parent_node(hir_id)) {
1503-
matches!(item.kind, ItemKind::Impl{ of_trait: Some(_), .. })
1503+
matches!(item.kind, ItemKind::Impl { of_trait: Some(_), .. })
15041504
} else {
15051505
false
15061506
}

0 commit comments

Comments
 (0)