From 7de4e06781c619741e43690dc8b05e12c2f0fbb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Bizjak?= Date: Fri, 5 May 2023 20:03:21 +0200 Subject: [PATCH] Explain redundant closure. --- concordium-std/src/impls.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/concordium-std/src/impls.rs b/concordium-std/src/impls.rs index ba953bab..76799ffc 100644 --- a/concordium-std/src/impls.rs +++ b/concordium-std/src/impls.rs @@ -2658,6 +2658,8 @@ impl UnwrapAbort for Option { #[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()) } }