Skip to content

Commit 03ff6e6

Browse files
committed
s/snippet/snippet_with_applicability while we're at it
1 parent 5d1f8a3 commit 03ff6e6

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

clippy_lints_internal/src/collapsible_span_lint_calls.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use clippy_utils::diagnostics::span_lint_and_sugg;
2-
use clippy_utils::source::{snippet, snippet_with_context};
2+
use clippy_utils::source::{snippet_with_applicability, snippet_with_context};
33
use clippy_utils::{SpanlessEq, is_lint_allowed, peel_blocks_with_stmt, sym};
44
use rustc_errors::Applicability;
55
use rustc_hir::{Closure, Expr, ExprKind};
@@ -147,9 +147,9 @@ fn get_and_then_snippets(
147147
msg_span: Span,
148148
app: &mut Applicability,
149149
) -> AndThenSnippets {
150-
let cx_snippet = snippet(cx, cx_span, "cx");
151-
let lint_snippet = snippet(cx, lint_span, "..");
152-
let span_snippet = snippet(cx, span_span, "span");
150+
let cx_snippet = snippet_with_applicability(cx, cx_span, "cx", app);
151+
let lint_snippet = snippet_with_applicability(cx, lint_span, "..", app);
152+
let span_snippet = snippet_with_applicability(cx, span_span, "span", app);
153153
let msg_snippet = snippet_with_context(cx, msg_span, expr_ctxt, r#""...""#, app).0;
154154

155155
AndThenSnippets {
@@ -174,7 +174,8 @@ fn span_suggestion_snippets<'hir>(
174174
) -> SpanSuggestionSnippets {
175175
let help_snippet = snippet_with_context(cx, span_call_args[1].span, expr_ctxt, r#""...""#, app).0;
176176
let sugg_snippet = snippet_with_context(cx, span_call_args[2].span, expr_ctxt, "..", app).0;
177-
let applicability_snippet = snippet(cx, span_call_args[3].span, "Applicability::MachineApplicable");
177+
let applicability_snippet =
178+
snippet_with_applicability(cx, span_call_args[3].span, "Applicability::MachineApplicable", app);
178179

179180
SpanSuggestionSnippets {
180181
help: help_snippet,

0 commit comments

Comments
 (0)