mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-10 15:14:29 +00:00
Fix grammar error.
This commit is contained in:
parent
1018b78f41
commit
77c48ca341
2 changed files with 5 additions and 5 deletions
|
@ -3268,7 +3268,7 @@ fn lint_filetype_is_file(cx: &LateContext<'_, '_>, expr: &hir::Expr<'_>, args: &
|
|||
return;
|
||||
}
|
||||
|
||||
let span: &hir::Expr<'_>;
|
||||
let span: Span;
|
||||
let verb: &str;
|
||||
let lint_unary: &str;
|
||||
let help_unary: &str;
|
||||
|
@ -3280,15 +3280,15 @@ fn lint_filetype_is_file(cx: &LateContext<'_, '_>, expr: &hir::Expr<'_>, args: &
|
|||
lint_unary = "!";
|
||||
verb = "denies";
|
||||
help_unary = "";
|
||||
span = parent;
|
||||
span = parent.span;
|
||||
} else {
|
||||
lint_unary = "";
|
||||
verb = "covers";
|
||||
help_unary = "!";
|
||||
span = expr;
|
||||
span = expr.span;
|
||||
}
|
||||
}
|
||||
let lint_msg = format!("`{}FileType::is_file()` only {} regular files", lint_unary, verb);
|
||||
let help_msg = format!("use `{}FileType::is_dir()` instead", help_unary);
|
||||
span_help_and_lint(cx, FILETYPE_IS_FILE, span.span, &lint_msg, &help_msg);
|
||||
span_help_and_lint(cx, FILETYPE_IS_FILE, span, &lint_msg, &help_msg);
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ LL | if fs::metadata("foo.txt")?.file_type().is_file() {
|
|||
= note: `-D clippy::filetype-is-file` implied by `-D warnings`
|
||||
= help: use `!FileType::is_dir()` instead
|
||||
|
||||
error: `!FileType::is_file()` only denys regular files
|
||||
error: `!FileType::is_file()` only denies regular files
|
||||
--> $DIR/filetype_is_file.rs:13:8
|
||||
|
|
||||
LL | if !fs::metadata("foo.txt")?.file_type().is_file() {
|
||||
|
|
Loading…
Reference in a new issue