Skip to content

Commit

Permalink
assists: permit same bodies when not testing
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
kinnison committed Dec 31, 2020
1 parent b43b337 commit 9b7455d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions crates/assists/src/handlers/infer_function_return_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ fn extract_tail(ctx: &AssistContext) -> Option<(FnType, ast::Expr, InsertOrRepla
(FnType::Function, tail_expr, ret_range, action)
};
let frange = ctx.frange.range;
#[cfg_attr(not(test), allow(clippy::if_same_then_else))]
if return_type_range.contains_range(frange) {
mark::hit!(cursor_in_ret_position);
mark::hit!(cursor_in_ret_position_closure);
Expand Down

0 comments on commit 9b7455d

Please sign in to comment.