Skip to content

Commit a05c9b6

Browse files
author
Michael Wright
committed
use_self: Simplify spanning
1 parent 5bb52c4 commit a05c9b6

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

clippy_lints/src/use_self.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::utils::{in_macro, span_lint_and_then};
1+
use crate::utils::{in_macro, span_lint_and_sugg};
22
use rustc::hir::intravisit::{walk_path, walk_ty, NestedVisitorMap, Visitor};
33
use rustc::hir::*;
44
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
@@ -51,9 +51,14 @@ impl LintPass for UseSelf {
5151
const SEGMENTS_MSG: &str = "segments should be composed of at least 1 element";
5252

5353
fn span_use_self_lint(cx: &LateContext, path: &Path) {
54-
span_lint_and_then(cx, USE_SELF, path.span, "unnecessary structure name repetition", |db| {
55-
db.span_suggestion(path.span, "use the applicable keyword", "Self".to_owned());
56-
});
54+
span_lint_and_sugg(
55+
cx,
56+
USE_SELF,
57+
path.span,
58+
"unnecessary structure name repetition",
59+
"use the applicable keyword",
60+
"Self".to_owned(),
61+
);
5762
}
5863

5964
struct TraitImplTyVisitor<'a, 'tcx: 'a> {

0 commit comments

Comments
 (0)