Skip to content

Commit af6dc6c

Browse files
committed
cargo dev fmt
1 parent c3acaf3 commit af6dc6c

File tree

7 files changed

+22
-20
lines changed

7 files changed

+22
-20
lines changed

clippy_lints/src/format.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::utils::paths;
22
use crate::utils::{
3-
is_expn_of, is_type_diagnostic_item, last_path_segment, match_def_path, match_function_call, snippet, span_lint_and_then,
4-
walk_ptrs_ty,
3+
is_expn_of, is_type_diagnostic_item, last_path_segment, match_def_path, match_function_call, snippet,
4+
span_lint_and_then, walk_ptrs_ty,
55
};
66
use if_chain::if_chain;
77
use rustc_ast::ast::LitKind;

clippy_lints/src/inherent_to_string.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use rustc_lint::{LateContext, LateLintPass};
44
use rustc_session::{declare_lint_pass, declare_tool_lint};
55

66
use crate::utils::{
7-
get_trait_def_id, is_type_diagnostic_item, implements_trait, paths, return_ty, span_lint_and_help, trait_ref_of_method,
8-
walk_ptrs_ty,
7+
get_trait_def_id, implements_trait, is_type_diagnostic_item, paths, return_ty, span_lint_and_help,
8+
trait_ref_of_method, walk_ptrs_ty,
99
};
1010

1111
declare_clippy_lint! {

clippy_lints/src/methods/inefficient_to_string.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
use super::INEFFICIENT_TO_STRING;
2-
use crate::utils::{match_def_path, is_type_diagnostic_item, paths, snippet_with_applicability, span_lint_and_then, walk_ptrs_ty_depth};
2+
use crate::utils::{
3+
is_type_diagnostic_item, match_def_path, paths, snippet_with_applicability, span_lint_and_then, walk_ptrs_ty_depth,
4+
};
35
use if_chain::if_chain;
46
use rustc_errors::Applicability;
57
use rustc_hir as hir;
@@ -45,16 +47,15 @@ pub fn lint<'tcx>(cx: &LateContext<'_, 'tcx>, expr: &hir::Expr<'_>, arg: &hir::E
4547
/// Currently, these are `str`, `String`, and `Cow<'_, str>`.
4648
fn specializes_tostring(cx: &LateContext<'_, '_>, ty: Ty<'_>) -> bool {
4749
if let ty::Str = ty.kind {
48-
return true
50+
return true;
4951
}
5052

5153
if is_type_diagnostic_item(cx, ty, sym!(string_type)) {
52-
return true
54+
return true;
5355
}
5456

5557
if let ty::Adt(adt, substs) = ty.kind {
56-
match_def_path(cx, adt.did, &paths::COW) &&
57-
substs.type_at(1).is_str()
58+
match_def_path(cx, adt.did, &paths::COW) && substs.type_at(1).is_str()
5859
} else {
5960
false
6061
}

clippy_lints/src/needless_pass_by_value.rs

+2-2
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, is_type_diagnostic_item, multispan_sugg, paths,
4-
snippet, snippet_opt, span_lint_and_then,
3+
get_trait_def_id, implements_trait, is_copy, is_self, is_type_diagnostic_item, multispan_sugg, paths, snippet,
4+
snippet_opt, span_lint_and_then,
55
};
66
use if_chain::if_chain;
77
use rustc_ast::ast::Attribute;

clippy_lints/src/redundant_clone.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::utils::{
2-
fn_has_unsatisfiable_preds, has_drop, is_copy, is_type_diagnostic_item, match_def_path, match_type, paths, snippet_opt, span_lint_hir,
3-
span_lint_hir_and_then, walk_ptrs_ty_depth,
2+
fn_has_unsatisfiable_preds, has_drop, is_copy, is_type_diagnostic_item, match_def_path, match_type, paths,
3+
snippet_opt, span_lint_hir, span_lint_hir_and_then, walk_ptrs_ty_depth,
44
};
55
use if_chain::if_chain;
66
use rustc_data_structures::{fx::FxHashMap, transitive_relation::TransitiveRelation};
@@ -113,7 +113,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for RedundantClone {
113113

114114
let from_borrow = match_def_path(cx, fn_def_id, &paths::CLONE_TRAIT_METHOD)
115115
|| match_def_path(cx, fn_def_id, &paths::TO_OWNED_METHOD)
116-
|| (match_def_path(cx, fn_def_id, &paths::TO_STRING_METHOD) && is_type_diagnostic_item(cx, arg_ty, sym!(string_type)));
116+
|| (match_def_path(cx, fn_def_id, &paths::TO_STRING_METHOD)
117+
&& is_type_diagnostic_item(cx, arg_ty, sym!(string_type)));
117118

118119
let from_deref = !from_borrow
119120
&& (match_def_path(cx, fn_def_id, &paths::PATH_TO_PATH_BUF)

clippy_lints/src/swap.rs

+2-2
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, is_type_diagnostic_item, snippet_with_applicability,
4-
span_lint_and_then, walk_ptrs_ty, SpanlessEq,
3+
differing_macro_contexts, is_type_diagnostic_item, snippet_with_applicability, span_lint_and_then, walk_ptrs_ty,
4+
SpanlessEq,
55
};
66
use if_chain::if_chain;
77
use rustc_errors::Applicability;

clippy_lints/src/types.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ use rustc_typeck::hir_ty_to_ty;
2929
use crate::consts::{constant, Constant};
3030
use crate::utils::paths;
3131
use crate::utils::{
32-
clip, comparisons, differing_macro_contexts, higher, in_constant, int_bits, is_type_diagnostic_item, last_path_segment, match_def_path,
33-
match_path, method_chain_args, multispan_sugg, numeric_literal::NumericLiteral, qpath_res, same_tys, sext, snippet,
34-
snippet_opt, snippet_with_applicability, snippet_with_macro_callsite, span_lint, span_lint_and_help,
35-
span_lint_and_sugg, span_lint_and_then, unsext,
32+
clip, comparisons, differing_macro_contexts, higher, in_constant, int_bits, is_type_diagnostic_item,
33+
last_path_segment, match_def_path, match_path, method_chain_args, multispan_sugg, numeric_literal::NumericLiteral,
34+
qpath_res, same_tys, sext, snippet, snippet_opt, snippet_with_applicability, snippet_with_macro_callsite,
35+
span_lint, span_lint_and_help, span_lint_and_sugg, span_lint_and_then, unsext,
3636
};
3737

3838
declare_clippy_lint! {

0 commit comments

Comments
 (0)