Skip to content

Commit 8eb2f12

Browse files
stepanchegfacebook-github-bot
authored andcommitted
Fix build in oss
Summary: Another very helpful clippy suggestion. ``` error: incorrect implementation of `partial_cmp` on an `Ord` type --> gazebo/src/phantom.rs:75:1 | 75 | / impl<T: ?Sized> PartialOrd<PhantomDataInvariant<T>> for PhantomDataInvariant<T> { 76 | | fn partial_cmp(&self, other: &PhantomDataInvariant<T>) -> Option<std::cmp::Ordering> { | | __________________________________________________________________________________________- 77 | || self.0.partial_cmp(&other.0) 78 | || } | ||_____- help: change this to: `{ Some(self.cmp(other)) }` 79 | | } | |__^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incorrect_partial_ord_impl_on_ord_type = note: `#[deny(clippy::incorrect_partial_ord_impl_on_ord_type)]` on by default``` Reviewed By: krallin Differential Revision: D48941842 fbshipit-source-id: 914da37629fc16b3324d9ae31321e4377c7f0fc1
1 parent f710b40 commit 8eb2f12

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gazebo/gazebo/src/phantom.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,6 @@ impl<T: ?Sized> PartialEq<PhantomDataInvariant<T>> for PhantomDataInvariant<T> {
7474

7575
impl<T: ?Sized> PartialOrd<PhantomDataInvariant<T>> for PhantomDataInvariant<T> {
7676
fn partial_cmp(&self, other: &PhantomDataInvariant<T>) -> Option<std::cmp::Ordering> {
77-
self.0.partial_cmp(&other.0)
77+
Some(self.cmp(other))
7878
}
7979
}

0 commit comments

Comments
 (0)