Skip to content

Commit 77c48ca

Browse files
committed
Fix grammar error.
1 parent 1018b78 commit 77c48ca

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
@@ -3268,7 +3268,7 @@ fn lint_filetype_is_file(cx: &LateContext<'_, '_>, expr: &hir::Expr<'_>, args: &
32683268
return;
32693269
}
32703270

3271-
let span: &hir::Expr<'_>;
3271+
let span: Span;
32723272
let verb: &str;
32733273
let lint_unary: &str;
32743274
let help_unary: &str;
@@ -3280,15 +3280,15 @@ fn lint_filetype_is_file(cx: &LateContext<'_, '_>, expr: &hir::Expr<'_>, args: &
32803280
lint_unary = "!";
32813281
verb = "denies";
32823282
help_unary = "";
3283-
span = parent;
3283+
span = parent.span;
32843284
} else {
32853285
lint_unary = "";
32863286
verb = "covers";
32873287
help_unary = "!";
3288-
span = expr;
3288+
span = expr.span;
32893289
}
32903290
}
32913291
let lint_msg = format!("`{}FileType::is_file()` only {} regular files", lint_unary, verb);
32923292
let help_msg = format!("use `{}FileType::is_dir()` instead", help_unary);
3293-
span_help_and_lint(cx, FILETYPE_IS_FILE, span.span, &lint_msg, &help_msg);
3293+
span_help_and_lint(cx, FILETYPE_IS_FILE, span, &lint_msg, &help_msg);
32943294
}

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)