diff options
| author | Yuki Okushi <huyuumi.dev@gmail.com> | 2020-01-27 10:56:22 +0900 |
|---|---|---|
| committer | Yuki Okushi <huyuumi.dev@gmail.com> | 2020-01-27 11:17:58 +0900 |
| commit | f60f12f71f2060f386d9765cd60b653a58519a08 (patch) | |
| tree | cb59402f5cfa744fd884c8bda0ec08a467810c09 /doc/adding_lints.md | |
| parent | 4f65bec39ab7cceea9d31e7245479037e9581219 (diff) | |
Rename `span_help_and_lint` to `span_lint_and_help`
Diffstat (limited to 'doc/adding_lints.md')
| -rw-r--r-- | doc/adding_lints.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/adding_lints.md b/doc/adding_lints.md index deecbf80a22..fcd7dd75760 100644 --- a/doc/adding_lints.md +++ b/doc/adding_lints.md @@ -249,14 +249,14 @@ Depending on how complex we want our lint message to be, we can choose from a variety of lint emission functions. They can all be found in [`clippy_lints/src/utils/diagnostics.rs`][diagnostics]. -`span_help_and_lint` seems most appropriate in this case. It allows us to +`span_lint_and_help` seems most appropriate in this case. It allows us to provide an extra help message and we can't really suggest a better name automatically. This is how it looks: ```rust impl EarlyLintPass for FooFunctions { fn check_fn(&mut self, cx: &EarlyContext<'_>, _: FnKind<'_>, _: &FnDecl, span: Span, _: NodeId) { - span_help_and_lint( + span_lint_and_help( cx, FOO_FUNCTIONS, span, @@ -284,7 +284,7 @@ With that we can expand our `check_fn` method to: impl EarlyLintPass for FooFunctions { fn check_fn(&mut self, cx: &EarlyContext<'_>, fn_kind: FnKind<'_>, _: &FnDecl, span: Span, _: NodeId) { if is_foo_fn(fn_kind) { - span_help_and_lint( + span_lint_and_help( cx, FOO_FUNCTIONS, span, |
