Skip to content

Commit 23d1d07

Browse files
committed
small refactor
1 parent 15ec5d2 commit 23d1d07

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

clippy_lints/src/returns.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use clippy_utils::diagnostics::span_lint_hir_and_then;
1+
use clippy_utils::diagnostics::{span_lint_hir_and_then, span_lint_and_then};
22
use clippy_utils::source::{snippet_opt, snippet_with_context};
33
use clippy_utils::{fn_def_id, path_to_local_id};
44
use if_chain::if_chain;
@@ -194,7 +194,6 @@ fn check_final_expr<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>, span:
194194
if !borrows {
195195
emit_return_lint(
196196
cx,
197-
inner.map_or(expr.hir_id, |inner| inner.hir_id),
198197
span,
199198
inner.as_ref().map(|i| i.span),
200199
replacement,
@@ -224,7 +223,6 @@ fn check_final_expr<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>, span:
224223

225224
fn emit_return_lint(
226225
cx: &LateContext<'_>,
227-
emission_place: HirId,
228226
ret_span: Span,
229227
inner_span: Option<Span>,
230228
replacement: RetReplacement,
@@ -245,10 +243,9 @@ fn emit_return_lint(
245243
} else {
246244
replacement.sugg_help()
247245
};
248-
span_lint_hir_and_then(
246+
span_lint_and_then(
249247
cx,
250248
NEEDLESS_RETURN,
251-
emission_place,
252249
ret_span,
253250
"unneeded `return` statement",
254251
|diag| {

0 commit comments

Comments
 (0)