mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +00:00
add missing traits to RocResult
This commit is contained in:
parent
7b1f2d2ac1
commit
d01fc9156c
1 changed files with 38 additions and 0 deletions
|
@ -101,6 +101,13 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
impl<T, E> Eq for RocResult<T, E>
|
||||
where
|
||||
T: Eq,
|
||||
E: Eq,
|
||||
{
|
||||
}
|
||||
|
||||
impl<T, E> PartialEq for RocResult<T, E>
|
||||
where
|
||||
T: PartialEq,
|
||||
|
@ -111,6 +118,37 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
impl<T, E> Ord for RocResult<T, E>
|
||||
where
|
||||
T: Ord,
|
||||
E: Ord,
|
||||
{
|
||||
fn cmp(&self, other: &Self) -> Ordering {
|
||||
self.as_result_of_refs().cmp(&other.as_result_of_refs())
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, E> PartialOrd for RocResult<T, E>
|
||||
where
|
||||
T: PartialOrd,
|
||||
E: PartialOrd,
|
||||
{
|
||||
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
|
||||
self.as_result_of_refs()
|
||||
.partial_cmp(&other.as_result_of_refs())
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, E> Hash for RocResult<T, E>
|
||||
where
|
||||
T: Hash,
|
||||
E: Hash,
|
||||
{
|
||||
fn hash<H: Hasher>(&self, state: &mut H) {
|
||||
self.as_result_of_refs().hash(state)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, E> Clone for RocResult<T, E>
|
||||
where
|
||||
T: Clone,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue