Skip to content

Commit 9b7455d

Browse files
committed
assists: permit same bodies when not testing
The bodies of the if ladder here only differ when in test mode. This attribute silences clippy's error here in non-test builds. Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
1 parent b43b337 commit 9b7455d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

crates/assists/src/handlers/infer_function_return_type.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ fn extract_tail(ctx: &AssistContext) -> Option<(FnType, ast::Expr, InsertOrRepla
108108
(FnType::Function, tail_expr, ret_range, action)
109109
};
110110
let frange = ctx.frange.range;
111+
#[cfg_attr(not(test), allow(clippy::if_same_then_else))]
111112
if return_type_range.contains_range(frange) {
112113
mark::hit!(cursor_in_ret_position);
113114
mark::hit!(cursor_in_ret_position_closure);

0 commit comments

Comments
 (0)