Skip to content

Commit

Permalink
remove unused ConstantTimeEq for Ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmicexplorer committed Jan 17, 2023
1 parent ff01955 commit 1975526
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -890,18 +890,6 @@ pub trait ConstantTimePartialOrd {
fn ct_partial_cmp(&self, other: &Self) -> CtOption<Ordering>;
}

impl ConstantTimeEq for Ordering {
/// Use our `#[repr(i8)]` to get a `ct_eq()` implementation without relying on any `match`es.
///
/// This also means `CtOption<Ordering>` implements `ConstantTimeEq`.
#[inline]
fn ct_eq(&self, other: &Self) -> Choice {
let a = *self as i8;
let b = *other as i8;
a.ct_eq(&b)
}
}

impl ConditionallySelectable for Ordering {
/// Delegate to [`i8::conditional_select()`], since [`Ordering`] is `#[repr(i8)]`.
#[inline]
Expand Down

0 comments on commit 1975526

Please sign in to comment.