Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,13 @@ impl<T: ConstantTimeEq> ConstantTimeEq for [T] {
}
}

impl ConstantTimeEq for str {
#[inline]
fn ct_eq(&self, rhs: &Self) -> Choice {
self.as_bytes().ct_eq(rhs.as_bytes())
}
}

impl ConstantTimeEq for Choice {
#[inline]
fn ct_eq(&self, rhs: &Choice) -> Choice {
Expand Down