Skip to content

Commit

Permalink
Merge pull request #95 from trevor-crypto/patch-1
Browse files Browse the repository at this point in the history
Add constant time warning to `unwrap_or_else`
  • Loading branch information
isislovecruft authored Feb 7, 2023
2 parents b4326d0 + fc843a9 commit 72993f2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,9 @@ impl<T> CtOption<T> {

/// 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<F>(self, f: F) -> T
where
Expand Down

0 comments on commit 72993f2

Please sign in to comment.