mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 18:03:37 +08:00
Implement PartialEq manually to shut up clippy
This commit is contained in:
parent
1073f59929
commit
6775b0b1ad
|
@ -56,10 +56,7 @@ mod topic_monitor_ffi {
|
|||
|
||||
/// The list of topics which may be observed.
|
||||
#[repr(u8)]
|
||||
// clippy 1.72 complains that the PartialOrd should be "{ Some(self.cmp(other)) }"
|
||||
// but that requires us to implement PartialOrd ourselves.
|
||||
#[allow(clippy::incorrect_partial_ord_impl_on_ord_type)]
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Ord)]
|
||||
pub enum topic_t {
|
||||
sighupint, // Corresponds to both SIGHUP and SIGINT signals.
|
||||
sigchld, // Corresponds to SIGCHLD signal.
|
||||
|
@ -78,6 +75,14 @@ mod topic_monitor_ffi {
|
|||
}
|
||||
}
|
||||
|
||||
// FIXME: #derive-ing this currently makes clippy complain
|
||||
// about https://rust-lang.github.io/rust-clippy/master/index.html#/incorrect_partial_ord_impl_on_ord_type
|
||||
impl PartialOrd for topic_t {
|
||||
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
|
||||
Some(self.cmp(other))
|
||||
}
|
||||
}
|
||||
|
||||
pub use topic_monitor_ffi::{generation_list_t, topic_t};
|
||||
pub type generation_t = u64;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user