Skip to content

Commit 601cbc6

Browse files
committed
fix formatting
1 parent 1fac380 commit 601cbc6

File tree

5 files changed

+15
-21
lines changed

5 files changed

+15
-21
lines changed

clippy_lints/src/functions.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,10 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Functions {
114114
span: Span,
115115
hir_id: hir::HirId,
116116
) {
117-
let is_impl = if let Some(hir::Node::Item(item)) = cx.tcx.hir().find_by_hir_id(
118-
cx.tcx.hir().get_parent_node_by_hir_id(hir_id))
117+
let is_impl = if let Some(hir::Node::Item(item)) = cx
118+
.tcx
119+
.hir()
120+
.find_by_hir_id(cx.tcx.hir().get_parent_node_by_hir_id(hir_id))
119121
{
120122
matches!(item.node, hir::ItemKind::Impl(_, _, _, _, Some(_), _, _))
121123
} else {

clippy_lints/src/needless_pass_by_value.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,10 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue {
103103
}
104104

105105
// Exclude non-inherent impls
106-
if let Some(Node::Item(item)) = cx.tcx.hir().find_by_hir_id(
107-
cx.tcx.hir().get_parent_node_by_hir_id(hir_id))
106+
if let Some(Node::Item(item)) = cx
107+
.tcx
108+
.hir()
109+
.find_by_hir_id(cx.tcx.hir().get_parent_node_by_hir_id(hir_id))
108110
{
109111
if matches!(item.node, ItemKind::Impl(_, _, _, _, Some(_), _, _) |
110112
ItemKind::Trait(..))

clippy_lints/src/redundant_clone.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ use rustc::ty;
1616
use rustc::{declare_tool_lint, lint_array};
1717
use rustc_errors::Applicability;
1818
use std::convert::TryFrom;
19-
use syntax::{
20-
source_map::{BytePos, Span},
21-
};
19+
use syntax::source_map::{BytePos, Span};
2220

2321
macro_rules! unwrap_or_continue {
2422
($x:expr) => {

clippy_lints/src/trivially_copy_pass_by_ref.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,10 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TriviallyCopyPassByRef {
186186
}
187187

188188
// Exclude non-inherent impls
189-
if let Some(Node::Item(item)) = cx.tcx.hir().find_by_hir_id(
190-
cx.tcx.hir().get_parent_node_by_hir_id(hir_id))
189+
if let Some(Node::Item(item)) = cx
190+
.tcx
191+
.hir()
192+
.find_by_hir_id(cx.tcx.hir().get_parent_node_by_hir_id(hir_id))
191193
{
192194
if matches!(item.node, ItemKind::Impl(_, _, _, _, Some(_), _, _) |
193195
ItemKind::Trait(..))

clippy_lints/src/types.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -174,19 +174,9 @@ impl LintPass for TypePass {
174174
}
175175

176176
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TypePass {
177-
fn check_fn(
178-
&mut self,
179-
cx: &LateContext<'_, '_>,
180-
_: FnKind<'_>,
181-
decl: &FnDecl,
182-
_: &Body,
183-
_: Span,
184-
id: HirId,
185-
) {
177+
fn check_fn(&mut self, cx: &LateContext<'_, '_>, _: FnKind<'_>, decl: &FnDecl, _: &Body, _: Span, id: HirId) {
186178
// skip trait implementations, see #605
187-
if let Some(hir::Node::Item(item)) = cx.tcx.hir().find_by_hir_id(
188-
cx.tcx.hir().get_parent_item(id))
189-
{
179+
if let Some(hir::Node::Item(item)) = cx.tcx.hir().find_by_hir_id(cx.tcx.hir().get_parent_item(id)) {
190180
if let ItemKind::Impl(_, _, _, _, Some(..), _, _) = item.node {
191181
return;
192182
}

0 commit comments

Comments
 (0)