Skip to content

Commit

Permalink
Add constant time warning to unwrap_or_else
Browse files Browse the repository at this point in the history
  • Loading branch information
trevor-crypto authored Aug 30, 2022
1 parent b4b070c commit fc843a9
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 @@ -626,6 +626,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 fc843a9

Please sign in to comment.