Skip to content

Commit 4183a93

Browse files
committed
Fix grammar error.
1 parent f3a50b7 commit 4183a93

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

clippy_lints/src/methods/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -3264,7 +3264,7 @@ fn lint_filetype_is_file(cx: &LateContext<'_, '_>, expr: &hir::Expr<'_>, args: &
32643264
return;
32653265
}
32663266

3267-
let span: &hir::Expr<'_>;
3267+
let span: Span;
32683268
let verb: &str;
32693269
let lint_unary: &str;
32703270
let help_unary: &str;
@@ -3276,15 +3276,15 @@ fn lint_filetype_is_file(cx: &LateContext<'_, '_>, expr: &hir::Expr<'_>, args: &
32763276
lint_unary = "!";
32773277
verb = "denies";
32783278
help_unary = "";
3279-
span = parent;
3279+
span = parent.span;
32803280
} else {
32813281
lint_unary = "";
32823282
verb = "covers";
32833283
help_unary = "!";
3284-
span = expr;
3284+
span = expr.span;
32853285
}
32863286
}
32873287
let lint_msg = format!("`{}FileType::is_file()` only {} regular files", lint_unary, verb);
32883288
let help_msg = format!("use `{}FileType::is_dir()` instead", help_unary);
3289-
span_help_and_lint(cx, FILETYPE_IS_FILE, span.span, &lint_msg, &help_msg);
3289+
span_help_and_lint(cx, FILETYPE_IS_FILE, span, &lint_msg, &help_msg);
32903290
}

tests/ui/filetype_is_file.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | if fs::metadata("foo.txt")?.file_type().is_file() {
77
= note: `-D clippy::filetype-is-file` implied by `-D warnings`
88
= help: use `!FileType::is_dir()` instead
99

10-
error: `!FileType::is_file()` only denys regular files
10+
error: `!FileType::is_file()` only denies regular files
1111
--> $DIR/filetype_is_file.rs:13:8
1212
|
1313
LL | if !fs::metadata("foo.txt")?.file_type().is_file() {

0 commit comments

Comments
 (0)