Skip to content

Commit

Permalink
Fix grammar error.
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongmao86 committed Jan 10, 2020
1 parent f3a50b7 commit 4183a93
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions clippy_lints/src/methods/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3264,7 +3264,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;
Expand All @@ -3276,15 +3276,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);
}
2 changes: 1 addition & 1 deletion tests/ui/filetype_is_file.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 4183a93

Please sign in to comment.