From fc843a9252bdbcee00fcd0a2fd93918e803503e8 Mon Sep 17 00:00:00 2001 From: Trevor Arjeski <72849114+trevor-crypto@users.noreply.github.com> Date: Tue, 30 Aug 2022 16:54:10 +0300 Subject: [PATCH] Add constant time warning to `unwrap_or_else` --- src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 27d05ee..75b84b0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -626,6 +626,9 @@ impl CtOption { /// This returns the underlying value if it is `Some` /// or the value produced by the provided closure otherwise. + /// + /// This operates in constant time, because the provided closure + /// is always called. #[inline] pub fn unwrap_or_else(self, f: F) -> T where