Skip to content

Commit fc843a9

Browse files
Add constant time warning to unwrap_or_else
1 parent b4b070c commit fc843a9

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
@@ -626,6 +626,9 @@ impl<T> CtOption<T> {
626626

627627
/// This returns the underlying value if it is `Some`
628628
/// or the value produced by the provided closure otherwise.
629+
///
630+
/// This operates in constant time, because the provided closure
631+
/// is always called.
629632
#[inline]
630633
pub fn unwrap_or_else<F>(self, f: F) -> T
631634
where

0 commit comments

Comments
 (0)