mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-19 14:51:13 -03:00
Implement PartialEq manually to shut up clippy
This commit is contained in:
@@ -56,10 +56,7 @@ pub struct generation_list_t {
|
||||
|
||||
/// 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 @@ pub enum topic_t {
|
||||
}
|
||||
}
|
||||
|
||||
// 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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user