Skip to content

Commit

Permalink
Explain redundant closure.
Browse files Browse the repository at this point in the history
  • Loading branch information
abizjak committed May 5, 2023
1 parent be31e22 commit 7de4e06
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions concordium-std/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2658,6 +2658,8 @@ impl<A> UnwrapAbort for Option<A> {

#[inline(always)]
#[allow(clippy::redundant_closure)]
// The redundant_closure here is needed since there is an implicit coercion from
// ! to A. This does not happen if we just use unwrap_or_else(crate::trap).
fn unwrap_abort(self) -> Self::Unwrap { self.unwrap_or_else(|| crate::trap()) }
}

Expand Down

0 comments on commit 7de4e06

Please sign in to comment.