Skip to content

Commit dfa88c6

Browse files
committed
Auto merge of #4534 - matthiaskrgr:fmt_, r=flip1995
run rustfmt I was getting local `cargo test` failures because of this, yet travis was green. changelog: none
2 parents 12bb7d6 + b729827 commit dfa88c6

File tree

8 files changed

+20
-20
lines changed

8 files changed

+20
-20
lines changed

clippy_lints/src/loops.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rustc::{declare_lint_pass, declare_tool_lint};
1111
// use rustc::middle::region::CodeExtent;
1212
use crate::consts::{constant, Constant};
1313
use crate::utils::usage::mutated_variables;
14-
use crate::utils::{sext, sugg, is_type_diagnostic_item};
14+
use crate::utils::{is_type_diagnostic_item, sext, sugg};
1515
use rustc::middle::expr_use_visitor::*;
1616
use rustc::middle::mem_categorization::cmt_;
1717
use rustc::middle::mem_categorization::Categorization;

clippy_lints/src/methods/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ use rustc::{declare_lint_pass, declare_tool_lint};
1616
use rustc_errors::Applicability;
1717
use syntax::ast;
1818
use syntax::source_map::Span;
19-
use syntax::symbol::{sym, Symbol, LocalInternedString};
19+
use syntax::symbol::{sym, LocalInternedString, Symbol};
2020

2121
use crate::utils::usage::mutated_variables;
2222
use crate::utils::{
2323
get_arg_name, get_parent_expr, get_trait_def_id, has_iter_method, implements_trait, in_macro, is_copy,
2424
is_ctor_function, is_expn_of, is_type_diagnostic_item, iter_input_pats, last_path_segment, match_def_path,
25-
match_qpath, match_trait_method, match_type, match_var, method_calls, method_chain_args, remove_blocks,
25+
match_qpath, match_trait_method, match_type, match_var, method_calls, method_chain_args, paths, remove_blocks,
2626
return_ty, same_tys, single_segment_path, snippet, snippet_with_applicability, snippet_with_macro_callsite,
27-
span_lint, span_lint_and_sugg, span_lint_and_then, span_note_and_lint, walk_ptrs_ty, walk_ptrs_ty_depth,
28-
SpanlessEq, sugg, paths, span_help_and_lint
27+
span_help_and_lint, span_lint, span_lint_and_sugg, span_lint_and_then, span_note_and_lint, sugg, walk_ptrs_ty,
28+
walk_ptrs_ty_depth, SpanlessEq,
2929
};
3030

3131
declare_clippy_lint! {
@@ -2988,7 +2988,7 @@ fn contains_return(expr: &hir::Expr) -> bool {
29882988
}
29892989
}
29902990

2991-
let mut visitor = RetCallFinder{ found: false };
2991+
let mut visitor = RetCallFinder { found: false };
29922992
visitor.visit_expr(expr);
29932993
visitor.found
29942994
}

clippy_lints/src/needless_pass_by_value.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::utils::ptr::get_spans;
22
use crate::utils::{
3-
get_trait_def_id, implements_trait, is_copy, is_self, match_type, multispan_sugg, paths, snippet, snippet_opt,
4-
span_lint_and_then, is_type_diagnostic_item,
3+
get_trait_def_id, implements_trait, is_copy, is_self, is_type_diagnostic_item, match_type, multispan_sugg, paths,
4+
snippet, snippet_opt, span_lint_and_then,
55
};
66
use if_chain::if_chain;
77
use matches::matches;

clippy_lints/src/ptr.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
//! Checks for usage of `&Vec[_]` and `&String`.
22
33
use crate::utils::ptr::get_spans;
4-
use crate::utils::{match_qpath, is_type_diagnostic_item, match_type, paths, snippet_opt,
5-
span_lint, span_lint_and_then, walk_ptrs_hir_ty};
4+
use crate::utils::{
5+
is_type_diagnostic_item, match_qpath, match_type, paths, snippet_opt, span_lint, span_lint_and_then,
6+
walk_ptrs_hir_ty,
7+
};
68
use if_chain::if_chain;
79
use rustc::hir::QPath;
810
use rustc::hir::*;

clippy_lints/src/swap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::utils::sugg::Sugg;
22
use crate::utils::{
3-
differing_macro_contexts, match_type, is_type_diagnostic_item, paths, snippet,
4-
span_lint_and_then, walk_ptrs_ty, SpanlessEq,
3+
differing_macro_contexts, is_type_diagnostic_item, match_type, paths, snippet, span_lint_and_then, walk_ptrs_ty,
4+
SpanlessEq,
55
};
66
use if_chain::if_chain;
77
use matches::matches;

clippy_lints/src/utils/mod.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ use syntax::ext::hygiene::ExpnKind;
4747
use syntax::source_map::{Span, DUMMY_SP};
4848
use syntax::symbol::{kw, Symbol};
4949

50-
use crate::reexport::*;
5150
use crate::consts::{constant, Constant};
51+
use crate::reexport::*;
5252

5353
/// Returns `true` if the two spans come from differing expansions (i.e., one is
5454
/// from a macro and one isn't).
@@ -671,15 +671,17 @@ pub fn walk_ptrs_ty_depth(ty: Ty<'_>) -> (Ty<'_>, usize) {
671671
}
672672

673673
/// Checks whether the given expression is a constant integer of the given value.
674-
/// unlike `is_integer_literal`, this version does const folding
674+
/// unlike `is_integer_literal`, this version does const folding
675675
pub fn is_integer_const(cx: &LateContext<'_, '_>, e: &Expr, value: u128) -> bool {
676676
if is_integer_literal(e, value) {
677677
return true;
678678
}
679679
let map = cx.tcx.hir();
680680
let parent_item = map.get_parent_item(e.hir_id);
681-
if let Some((Constant::Int(v), _)) = map.maybe_body_owned_by(parent_item)
682-
.and_then(|body_id| constant(cx, cx.tcx.body_tables(body_id), e)) {
681+
if let Some((Constant::Int(v), _)) = map
682+
.maybe_body_owned_by(parent_item)
683+
.and_then(|body_id| constant(cx, cx.tcx.body_tables(body_id), e))
684+
{
683685
value == v
684686
} else {
685687
false

tests/ui/or_fun_call.fixed

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ fn test_or_with_ctors() {
9999
.or(Some(Bar(b, Duration::from_secs(2))));
100100
}
101101

102-
103102
// Issue 4514 - early return
104103
fn f() -> Option<()> {
105104
let a = Some(1);
@@ -110,5 +109,4 @@ fn f() -> Option<()> {
110109
Some(())
111110
}
112111

113-
114112
fn main() {}

tests/ui/or_fun_call.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ fn test_or_with_ctors() {
9999
.or(Some(Bar(b, Duration::from_secs(2))));
100100
}
101101

102-
103102
// Issue 4514 - early return
104103
fn f() -> Option<()> {
105104
let a = Some(1);
@@ -110,5 +109,4 @@ fn f() -> Option<()> {
110109
Some(())
111110
}
112111

113-
114112
fn main() {}

0 commit comments

Comments
 (0)