Skip to content

Commit 72993f2

Browse files
Merge pull request #95 from trevor-crypto/patch-1
Add constant time warning to `unwrap_or_else`
2 parents b4326d0 + fc843a9 commit 72993f2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,9 @@ impl<T> CtOption<T> {
651651

652652
/// This returns the underlying value if it is `Some`
653653
/// or the value produced by the provided closure otherwise.
654+
///
655+
/// This operates in constant time, because the provided closure
656+
/// is always called.
654657
#[inline]
655658
pub fn unwrap_or_else<F>(self, f: F) -> T
656659
where

0 commit comments

Comments
 (0)