Skip to content

Commit

Permalink
Refactor trait bounds for CRange to restrict to target types that imp…
Browse files Browse the repository at this point in the history
…l PartialOrd and PartialEq
  • Loading branch information
anthonyray committed Mar 23, 2020
1 parent 51e1400 commit 048c324
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ffi-convert/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ pub struct CRange<T> {
pub end: T,
}

impl<U: AsRust<V> + PartialOrd, V: PartialOrd> AsRust<Range<V>> for CRange<U> {
impl<U: AsRust<V>, V: PartialOrd + PartialEq> AsRust<Range<V>> for CRange<U> {
fn as_rust(&self) -> Result<Range<V>, Error> {
Ok(Range {
start: self.start.as_rust()?,
Expand All @@ -220,7 +220,7 @@ impl<U: AsRust<V> + PartialOrd, V: PartialOrd> AsRust<Range<V>> for CRange<U> {
}
}

impl<U: CReprOf<V> + PartialOrd + CDrop, V: PartialOrd> CReprOf<Range<V>> for CRange<U> {
impl<U: CReprOf<V> + CDrop, V: PartialOrd + PartialEq> CReprOf<Range<V>> for CRange<U> {
fn c_repr_of(input: Range<V>) -> Result<Self, Error> {
Ok(Self {
start: U::c_repr_of(input.start)?,
Expand Down

0 comments on commit 048c324

Please sign in to comment.