Skip to content

Commit 2930765

Browse files
committed
rustfmt
1 parent 1701c25 commit 2930765

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

clippy_lints/src/loops.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use crate::utils::usage::{is_unused, mutated_variables};
55
use crate::utils::{
66
get_enclosing_block, get_parent_expr, get_trait_def_id, has_iter_method, higher, implements_trait,
77
is_integer_const, is_no_std_crate, is_refutable, last_path_segment, match_trait_method, match_type, match_var,
8-
multispan_sugg, snippet, snippet_opt, snippet_with_applicability, snippet_with_macro_callsite, span_lint, span_lint_and_help,
9-
span_lint_and_sugg, span_lint_and_then, SpanlessEq,
8+
multispan_sugg, snippet, snippet_opt, snippet_with_applicability, snippet_with_macro_callsite, span_lint,
9+
span_lint_and_help, span_lint_and_sugg, span_lint_and_then, SpanlessEq,
1010
};
1111
use crate::utils::{is_type_diagnostic_item, qpath_res, sugg};
1212
use if_chain::if_chain;
@@ -1081,7 +1081,8 @@ fn has_mutable_variables<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) ->
10811081
def_id.expect_local(),
10821082
cx.param_env,
10831083
cx.typeck_results(),
1084-
).walk_expr(expr);
1084+
)
1085+
.walk_expr(expr);
10851086
});
10861087

10871088
delegate.found_mutable
@@ -1271,7 +1272,7 @@ fn detect_same_item_push<'tcx>(
12711272
SAME_ITEM_PUSH,
12721273
vec.span,
12731274
"it looks like the same item is being pushed into this Vec",
1274-
None,
1275+
None,
12751276
&format!(
12761277
"try using vec![{};SIZE] or {}.resize(NEW_SIZE, {})",
12771278
item_str, vec_str, item_str

tests/ui/same_item_push.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ fn main() {
8080
}
8181
let mut vec_a: Vec<A> = Vec::new();
8282
for i in 0..30 {
83-
vec_a.push(A{kind: i});
83+
vec_a.push(A { kind: i });
8484
}
8585
let mut vec12: Vec<u8> = Vec::new();
8686
for a in vec_a {

0 commit comments

Comments
 (0)