Skip to content

Commit dfbc74b

Browse files
committed
Rustfmt all the things
1 parent af80c53 commit dfbc74b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+241
-208
lines changed

clippy_lints/src/approx_const.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
use crate::utils::span_lint;
22
use crate::utils::sym;
3+
use lazy_static::lazy_static;
34
use rustc::hir::*;
45
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
56
use rustc::{declare_lint_pass, declare_tool_lint};
67
use std::f64::consts as f64;
78
use syntax::ast::{FloatTy, LitKind};
89
use syntax::symbol;
910
use syntax::symbol::Symbol;
10-
use lazy_static::lazy_static;
1111

1212
declare_clippy_lint! {
1313
/// **What it does:** Checks for floating point literals that approximate

clippy_lints/src/assertions_on_constants.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use rustc::{declare_lint_pass, declare_tool_lint};
55
use syntax_pos::Span;
66

77
use crate::consts::{constant, Constant};
8-
use crate::utils::{in_macro_or_desugar, is_direct_expn_of, span_help_and_lint};
98
use crate::utils::sym;
9+
use crate::utils::{in_macro_or_desugar, is_direct_expn_of, span_help_and_lint};
1010

1111
declare_clippy_lint! {
1212
/// **What it does:** Checks for `assert!(true)` and `assert!(false)` calls.

clippy_lints/src/attrs.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
//! checks for attributes
22
33
use crate::reexport::*;
4+
use crate::utils::sym;
45
use crate::utils::{
5-
in_macro_or_desugar, is_present_in_source, last_line_of_span, paths, snippet_opt, span_lint, span_lint_and_sugg,
6-
span_lint_and_then, without_block_comments, match_def_path
6+
in_macro_or_desugar, is_present_in_source, last_line_of_span, match_def_path, paths, snippet_opt, span_lint,
7+
span_lint_and_sugg, span_lint_and_then, without_block_comments,
78
};
8-
use crate::utils::sym;
99
use if_chain::if_chain;
1010
use rustc::hir::*;
1111
use rustc::lint::{
@@ -245,7 +245,9 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Attributes {
245245
for lint in lint_list {
246246
match item.node {
247247
ItemKind::Use(..) => {
248-
if is_word(lint, *sym::unused_imports) || is_word(lint, *sym::deprecated) {
248+
if is_word(lint, *sym::unused_imports)
249+
|| is_word(lint, *sym::deprecated)
250+
{
249251
return;
250252
}
251253
},

clippy_lints/src/booleans.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
use crate::utils::sym;
12
use crate::utils::{
23
get_trait_def_id, implements_trait, in_macro, in_macro_or_desugar, match_type, paths, snippet_opt,
34
span_lint_and_then, SpanlessEq,
45
};
5-
use crate::utils::sym;
6+
use lazy_static::lazy_static;
67
use rustc::hir::intravisit::*;
78
use rustc::hir::*;
89
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
@@ -12,7 +13,6 @@ use rustc_errors::Applicability;
1213
use syntax::ast::LitKind;
1314
use syntax::source_map::{dummy_spanned, Span, DUMMY_SP};
1415
use syntax::symbol::Symbol;
15-
use lazy_static::lazy_static;
1616

1717
declare_clippy_lint! {
1818
/// **What it does:** Checks for boolean expressions that can be written more

clippy_lints/src/bytecount.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
use crate::utils::sym;
12
use crate::utils::{
23
contains_name, get_pat_name, match_type, paths, single_segment_path, snippet_with_applicability,
34
span_lint_and_sugg, walk_ptrs_ty,
45
};
5-
use crate::utils::sym;
66
use if_chain::if_chain;
77
use rustc::hir::*;
88
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};

clippy_lints/src/dbg_macro.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use crate::utils::{snippet_opt, span_help_and_lint, span_lint_and_sugg};
21
use crate::utils::sym;
2+
use crate::utils::{snippet_opt, span_help_and_lint, span_lint_and_sugg};
33
use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
44
use rustc::{declare_lint_pass, declare_tool_lint};
55
use rustc_errors::Applicability;

clippy_lints/src/default_trait_access.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use rustc::ty;
55
use rustc::{declare_lint_pass, declare_tool_lint};
66
use rustc_errors::Applicability;
77

8-
use crate::utils::{any_parent_is_automatically_derived, paths, span_lint_and_sugg, match_def_path};
8+
use crate::utils::{any_parent_is_automatically_derived, match_def_path, paths, span_lint_and_sugg};
99

1010
declare_clippy_lint! {
1111
/// **What it does:** Checks for literal calls to `Default::default()`.

clippy_lints/src/drop_bounds.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::utils::{paths, span_lint, match_def_path};
1+
use crate::utils::{match_def_path, paths, span_lint};
22
use if_chain::if_chain;
33
use rustc::hir::*;
44
use rustc::lint::{LateLintPass, LintArray, LintPass};

clippy_lints/src/drop_forget_ref.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::utils::{is_copy, paths, span_note_and_lint, match_def_path};
1+
use crate::utils::{is_copy, match_def_path, paths, span_note_and_lint};
22
use if_chain::if_chain;
33
use rustc::hir::*;
44
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};

clippy_lints/src/entry.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use crate::utils::SpanlessEq;
21
use crate::utils::sym;
2+
use crate::utils::SpanlessEq;
33
use crate::utils::{get_item_name, higher, match_type, paths, snippet, span_lint_and_then, walk_ptrs_ty};
44
use if_chain::if_chain;
55
use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};

clippy_lints/src/explicit_write.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use crate::utils::{is_expn_of, resolve_node, span_lint, span_lint_and_sugg, match_def_path};
21
use crate::utils::sym;
2+
use crate::utils::{is_expn_of, match_def_path, paths, resolve_node, span_lint, span_lint_and_sugg};
33
use if_chain::if_chain;
44
use rustc::hir::*;
55
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
@@ -42,11 +42,10 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ExplicitWrite {
4242
if write_args.len() > 0;
4343
if let ExprKind::Call(ref dest_fun, _) = write_args[0].node;
4444
if let ExprKind::Path(ref qpath) = dest_fun.node;
45-
if let Some(dest_fun_id) =
46-
resolve_node(cx, qpath, dest_fun.hir_id).opt_def_id();
47-
if let Some(dest_name) = if match_def_path(cx, dest_fun_id, &[*sym::std, *sym::io, *sym::stdio, *sym::stdout]) {
45+
if let Some(dest_fun_id) = resolve_node(cx, qpath, dest_fun.hir_id).opt_def_id();
46+
if let Some(dest_name) = if match_def_path(cx, dest_fun_id, &*paths::STDOUT) {
4847
Some("stdout")
49-
} else if match_def_path(cx, dest_fun_id, &[*sym::std, *sym::io, *sym::stdio, *sym::stderr]) {
48+
} else if match_def_path(cx, dest_fun_id, &*paths::STDERR) {
5049
Some("stderr")
5150
} else {
5251
None

clippy_lints/src/fallible_impl_from.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
use crate::utils::paths::{BEGIN_PANIC, BEGIN_PANIC_FMT, FROM_TRAIT, OPTION, RESULT};
2-
use crate::utils::{is_expn_of, method_chain_args, span_lint_and_then, walk_ptrs_ty, match_def_path};
32
use crate::utils::sym;
3+
use crate::utils::{is_expn_of, match_def_path, method_chain_args, span_lint_and_then, walk_ptrs_ty};
44
use if_chain::if_chain;
55
use rustc::hir;
66
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
77
use rustc::ty::{self, Ty};
88
use rustc::{declare_lint_pass, declare_tool_lint};
9-
use syntax_pos::Span;
109
use syntax::symbol::Symbol;
10+
use syntax_pos::Span;
1111

1212
declare_clippy_lint! {
1313
/// **What it does:** Checks for impls of `From<..>` that contain `panic!()` or `unwrap()`

clippy_lints/src/format.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use crate::utils::paths;
22
use crate::utils::sym;
33
use crate::utils::{
4-
in_macro_or_desugar, is_expn_of, last_path_segment, match_type, resolve_node, snippet, span_lint_and_then,
5-
walk_ptrs_ty, match_def_path,
4+
in_macro_or_desugar, is_expn_of, last_path_segment, match_def_path, match_type, resolve_node, snippet,
5+
span_lint_and_then, walk_ptrs_ty,
66
};
77
use if_chain::if_chain;
88
use rustc::hir::*;

clippy_lints/src/identity_conversion.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::utils::{
2-
in_macro_or_desugar, match_trait_method, same_tys, snippet, snippet_with_macro_callsite, span_lint_and_then,
3-
match_def_path,
2+
in_macro_or_desugar, match_def_path, match_trait_method, same_tys, snippet, snippet_with_macro_callsite,
3+
span_lint_and_then,
44
};
55
use crate::utils::{paths, resolve_node};
66
use rustc::hir::*;

clippy_lints/src/implicit_return.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use crate::utils::{in_macro_or_desugar, is_expn_of, snippet_opt, span_lint_and_then};
21
use crate::utils::sym;
2+
use crate::utils::{in_macro_or_desugar, is_expn_of, snippet_opt, span_lint_and_then};
33
use rustc::hir::{intravisit::FnKind, Body, ExprKind, FnDecl, HirId, MatchSource};
44
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
55
use rustc::{declare_lint_pass, declare_tool_lint};

clippy_lints/src/infinite_iter.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ use rustc::hir::*;
22
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
33
use rustc::{declare_lint_pass, declare_tool_lint};
44

5-
use crate::utils::{get_trait_def_id, higher, implements_trait, match_qpath, match_type, paths, span_lint};
65
use crate::utils::sym;
7-
use syntax::symbol::Symbol;
6+
use crate::utils::{get_trait_def_id, higher, implements_trait, match_qpath, match_type, paths, span_lint};
87
use lazy_static::lazy_static;
8+
use syntax::symbol::Symbol;
99

1010
declare_clippy_lint! {
1111
/// **What it does:** Checks for iteration that is guaranteed to be infinite.

clippy_lints/src/invalid_ref.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::utils::{paths, span_help_and_lint, match_def_path};
1+
use crate::utils::{match_def_path, paths, span_help_and_lint};
22
use if_chain::if_chain;
33
use rustc::hir::*;
44
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};

clippy_lints/src/len_zero.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
use crate::utils::sym;
12
use crate::utils::{
23
get_item_name, in_macro_or_desugar, snippet_with_applicability, span_lint, span_lint_and_sugg, walk_ptrs_ty,
34
};
4-
use crate::utils::sym;
55
use rustc::hir::def_id::DefId;
66
use rustc::hir::*;
77
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
@@ -141,7 +141,8 @@ fn check_trait_items(cx: &LateContext<'_, '_>, visited_trait: &Item, trait_items
141141
}
142142
}
143143

144-
if cx.access_levels.is_exported(visited_trait.hir_id) && trait_items.iter().any(|i| is_named_self(cx, i, *sym::len)) {
144+
if cx.access_levels.is_exported(visited_trait.hir_id) && trait_items.iter().any(|i| is_named_self(cx, i, *sym::len))
145+
{
145146
let mut current_and_super_traits = FxHashSet::default();
146147
let visited_trait_def_id = cx.tcx.hir().local_def_id_from_hir_id(visited_trait.hir_id);
147148
fill_trait_set(visited_trait_def_id, &mut current_and_super_traits, cx);

clippy_lints/src/lifetimes.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,9 @@ struct BodyLifetimeChecker {
476476
impl<'tcx> Visitor<'tcx> for BodyLifetimeChecker {
477477
// for lifetimes as parameters of generics
478478
fn visit_lifetime(&mut self, lifetime: &'tcx Lifetime) {
479-
if lifetime.name.ident().name != keywords::Invalid.name() && lifetime.name.ident().name != syntax::symbol::keywords::StaticLifetime.name() {
479+
if lifetime.name.ident().name != keywords::Invalid.name()
480+
&& lifetime.name.ident().name != syntax::symbol::keywords::StaticLifetime.name()
481+
{
480482
self.lifetimes_used_in_body = true;
481483
}
482484
}

clippy_lints/src/loops.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ use rustc::middle::region;
1010
use rustc::{declare_lint_pass, declare_tool_lint};
1111
// use rustc::middle::region::CodeExtent;
1212
use crate::consts::{constant, Constant};
13+
use crate::utils::sym;
1314
use crate::utils::usage::mutated_variables;
1415
use crate::utils::{in_macro_or_desugar, sext, sugg};
15-
use crate::utils::sym;
1616
use rustc::middle::expr_use_visitor::*;
1717
use rustc::middle::mem_categorization::cmt_;
1818
use rustc::middle::mem_categorization::Categorization;
@@ -594,7 +594,10 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Loops {
594594
fn check_stmt(&mut self, cx: &LateContext<'a, 'tcx>, stmt: &'tcx Stmt) {
595595
if let StmtKind::Semi(ref expr) = stmt.node {
596596
if let ExprKind::MethodCall(ref method, _, ref args) = expr.node {
597-
if args.len() == 1 && method.ident.name == *sym::collect && match_trait_method(cx, expr, &*paths::ITERATOR) {
597+
if args.len() == 1
598+
&& method.ident.name == *sym::collect
599+
&& match_trait_method(cx, expr, &*paths::ITERATOR)
600+
{
598601
span_lint(
599602
cx,
600603
UNUSED_COLLECT,

clippy_lints/src/matches.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::consts::{constant, Constant};
22
use crate::utils::paths;
3-
use crate::utils::sym;
43
use crate::utils::sugg::Sugg;
4+
use crate::utils::sym;
55
use crate::utils::{
66
expr_block, in_macro_or_desugar, is_allowed, is_expn_of, match_qpath, match_type, multispan_sugg, remove_blocks,
77
snippet, snippet_with_applicability, span_lint_and_sugg, span_lint_and_then, span_note_and_lint, walk_ptrs_ty,

clippy_lints/src/mem_discriminant.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::utils::{paths, snippet, span_lint_and_then, walk_ptrs_ty_depth, match_def_path};
1+
use crate::utils::{match_def_path, paths, snippet, span_lint_and_then, walk_ptrs_ty_depth};
22
use if_chain::if_chain;
33
use rustc::hir::{Expr, ExprKind};
44
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};

clippy_lints/src/mem_forget.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::utils::{paths, span_lint, match_def_path};
1+
use crate::utils::{match_def_path, paths, span_lint};
22
use rustc::hir::{Expr, ExprKind};
33
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
44
use rustc::{declare_lint_pass, declare_tool_lint};

clippy_lints/src/mem_replace.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::utils::{match_qpath, paths, snippet_with_applicability, span_lint_and_sugg, match_def_path};
1+
use crate::utils::{match_def_path, match_qpath, paths, snippet_with_applicability, span_lint_and_sugg};
22
use if_chain::if_chain;
33
use rustc::hir::{Expr, ExprKind, MutMutable, QPath};
44
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};

clippy_lints/src/methods/mod.rs

+28-13
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use std::fmt;
66
use std::iter;
77

88
use if_chain::if_chain;
9+
use lazy_static::lazy_static;
910
use matches::matches;
1011
use rustc::hir;
1112
use rustc::hir::def::{DefKind, Res};
@@ -16,18 +17,16 @@ use rustc_errors::Applicability;
1617
use syntax::ast;
1718
use syntax::source_map::{BytePos, Span};
1819
use syntax::symbol::{LocalInternedString, Symbol};
19-
use lazy_static::lazy_static;
2020

2121
use crate::utils::paths;
2222
use crate::utils::sugg;
2323
use crate::utils::sym;
2424
use crate::utils::{
2525
get_arg_name, get_parent_expr, get_trait_def_id, has_iter_method, implements_trait, in_macro, is_copy,
26-
is_ctor_function, is_expn_of, is_self, is_self_ty, iter_input_pats, last_path_segment, match_path, match_qpath,
27-
match_trait_method, match_type, match_var, method_calls, method_chain_args, remove_blocks, return_ty, same_tys,
28-
single_segment_path, snippet, snippet_with_applicability, snippet_with_macro_callsite, span_lint,
26+
is_ctor_function, is_expn_of, is_self, is_self_ty, iter_input_pats, last_path_segment, match_def_path, match_path,
27+
match_qpath, match_trait_method, match_type, match_var, method_calls, method_chain_args, remove_blocks, return_ty,
28+
same_tys, single_segment_path, snippet, snippet_with_applicability, snippet_with_macro_callsite, span_lint,
2929
span_lint_and_sugg, span_lint_and_then, span_note_and_lint, walk_ptrs_ty, walk_ptrs_ty_depth, SpanlessEq,
30-
match_def_path,
3130
};
3231

3332
declare_clippy_lint! {
@@ -1068,7 +1067,8 @@ fn lint_or_fun_call(cx: &LateContext<'_, '_>, expr: &hir::Expr, method_span: Spa
10681067

10691068
if ["default", "new"].contains(&path) {
10701069
let arg_ty = cx.tables.expr_ty(arg);
1071-
let default_trait_id = if let Some(default_trait_id) = get_trait_def_id(cx, &*paths::DEFAULT_TRAIT) {
1070+
let default_trait_id = if let Some(default_trait_id) = get_trait_def_id(cx, &*paths::DEFAULT_TRAIT)
1071+
{
10721072
default_trait_id
10731073
} else {
10741074
return false;
@@ -2216,15 +2216,33 @@ fn lint_chars_cmp_with_unwrap<'a, 'tcx>(
22162216

22172217
/// Checks for the `CHARS_NEXT_CMP` lint with `unwrap()`.
22182218
fn lint_chars_next_cmp_with_unwrap<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, info: &BinaryExprInfo<'_>) -> bool {
2219-
lint_chars_cmp_with_unwrap(cx, info, &[*sym::chars, *sym::next, *sym::unwrap], CHARS_NEXT_CMP, "starts_with")
2219+
lint_chars_cmp_with_unwrap(
2220+
cx,
2221+
info,
2222+
&[*sym::chars, *sym::next, *sym::unwrap],
2223+
CHARS_NEXT_CMP,
2224+
"starts_with",
2225+
)
22202226
}
22212227

22222228
/// Checks for the `CHARS_LAST_CMP` lint with `unwrap()`.
22232229
fn lint_chars_last_cmp_with_unwrap<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, info: &BinaryExprInfo<'_>) -> bool {
2224-
if lint_chars_cmp_with_unwrap(cx, info, &[*sym::chars, *sym::last, *sym::unwrap], CHARS_LAST_CMP, "ends_with") {
2230+
if lint_chars_cmp_with_unwrap(
2231+
cx,
2232+
info,
2233+
&[*sym::chars, *sym::last, *sym::unwrap],
2234+
CHARS_LAST_CMP,
2235+
"ends_with",
2236+
) {
22252237
true
22262238
} else {
2227-
lint_chars_cmp_with_unwrap(cx, info, &[*sym::chars, *sym::next_back, *sym::unwrap], CHARS_LAST_CMP, "ends_with")
2239+
lint_chars_cmp_with_unwrap(
2240+
cx,
2241+
info,
2242+
&[*sym::chars, *sym::next_back, *sym::unwrap],
2243+
CHARS_LAST_CMP,
2244+
"ends_with",
2245+
)
22282246
}
22292247
}
22302248

@@ -2288,10 +2306,7 @@ fn lint_asref(cx: &LateContext<'_, '_>, expr: &hir::Expr, call_name: &str, as_re
22882306
}
22892307
}
22902308

2291-
fn ty_has_iter_method(
2292-
cx: &LateContext<'_, '_>,
2293-
self_ref_ty: Ty<'_>,
2294-
) -> Option<(&'static Lint, Symbol, &'static str)> {
2309+
fn ty_has_iter_method(cx: &LateContext<'_, '_>, self_ref_ty: Ty<'_>) -> Option<(&'static Lint, Symbol, &'static str)> {
22952310
if let Some(ty_name) = has_iter_method(cx, self_ref_ty) {
22962311
let lint = if ty_name == *sym::array || ty_name == *sym::PathBuf {
22972312
INTO_ITER_ON_ARRAY

clippy_lints/src/minmax.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::consts::{constant_simple, Constant};
2-
use crate::utils::{paths, span_lint, match_def_path};
2+
use crate::utils::{match_def_path, paths, span_lint};
33
use rustc::hir::*;
44
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
55
use rustc::{declare_lint_pass, declare_tool_lint};

clippy_lints/src/misc.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,8 @@ fn check_to_owned(cx: &LateContext<'_, '_>, expr: &Expr, other: &Expr) {
505505
},
506506
ExprKind::Call(ref path, ref v) if v.len() == 1 => {
507507
if let ExprKind::Path(ref path) = path.node {
508-
if match_qpath(path, &[*sym::String, *sym::from_str]) || match_qpath(path, &[*sym::String, *sym::from]) {
508+
if match_qpath(path, &[*sym::String, *sym::from_str]) || match_qpath(path, &[*sym::String, *sym::from])
509+
{
509510
(cx.tables.expr_ty_adjusted(&v[0]), snippet(cx, v[0].span, ".."))
510511
} else {
511512
return;

clippy_lints/src/missing_doc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
// [`missing_doc`]: https://github.com/rust-lang/rust/blob/d6d05904697d89099b55da3331155392f1db9c00/src/librustc_lint/builtin.rs#L246
66
//
77

8-
use crate::utils::{in_macro_or_desugar, span_lint};
98
use crate::utils::sym;
9+
use crate::utils::{in_macro_or_desugar, span_lint};
1010
use if_chain::if_chain;
1111
use rustc::hir;
1212
use rustc::lint::{LateContext, LateLintPass, LintArray, LintContext, LintPass};

0 commit comments

Comments
 (0)