Skip to content

Commit

Permalink
Use consistent style for Equivalent and Comparable too
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed Jan 22, 2025
1 parent 45469ec commit 3df3fa7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ pub trait Equivalent<K: ?Sized> {
fn equivalent(&self, key: &K) -> bool;
}

impl<Q: ?Sized, K: ?Sized> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
where
Q: Eq,
K: Borrow<Q>,
Q: ?Sized + Eq,
K: ?Sized + Borrow<Q>,
{
#[inline]
fn equivalent(&self, key: &K) -> bool {
Expand All @@ -108,10 +108,10 @@ pub trait Comparable<K: ?Sized>: Equivalent<K> {
fn compare(&self, key: &K) -> Ordering;
}

impl<Q: ?Sized, K: ?Sized> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
where
Q: Ord,
K: Borrow<Q>,
Q: ?Sized + Ord,
K: ?Sized + Borrow<Q>,
{
#[inline]
fn compare(&self, key: &K) -> Ordering {
Expand Down

0 comments on commit 3df3fa7

Please sign in to comment.