Skip to content

Commit 26c4143

Browse files
committed
scx_utils: fix clippy error.
error: you are deriving `Hash` but have implemented `PartialEq` explicitly --> rust/scx_utils/src/energy_model.rs:27:28 | 27 | #[derive(Debug, Clone, Eq, Hash, Ord, PartialOrd)]
1 parent 19c58b3 commit 26c4143

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

rust/scx_utils/src/energy_model.rs

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use std::fmt;
2424
use std::path::Path;
2525
use std::sync::Arc;
2626

27-
#[derive(Debug, Clone, Eq, Hash, Ord, PartialOrd)]
27+
#[derive(Debug, Clone, Eq, Hash, Ord, PartialEq, PartialOrd)]
2828
pub struct PerfState {
2929
pub cost: usize,
3030
pub frequency: usize,
@@ -33,7 +33,7 @@ pub struct PerfState {
3333
pub power: usize,
3434
}
3535

36-
#[derive(Debug, Clone, Eq, Hash, Ord, PartialOrd)]
36+
#[derive(Debug, Clone, Eq, Hash, Ord, PartialEq, PartialOrd)]
3737
pub struct PerfDomain {
3838
/// Monotonically increasing unique id.
3939
pub id: usize,
@@ -130,12 +130,6 @@ impl PerfDomain {
130130
}
131131
}
132132

133-
impl PartialEq for PerfDomain {
134-
fn eq(&self, other: &Self) -> bool {
135-
self.id == other.id && self.span == other.span && self.perf_table == other.perf_table
136-
}
137-
}
138-
139133
impl PerfState {
140134
/// Build a PerfState
141135
pub fn new(root: String) -> Result<PerfState> {
@@ -155,15 +149,6 @@ impl PerfState {
155149
}
156150
}
157151

158-
impl PartialEq for PerfState {
159-
fn eq(&self, other: &Self) -> bool {
160-
self.cost == other.cost
161-
&& self.frequency == other.frequency
162-
&& self.performance == other.performance
163-
&& self.power == other.power
164-
}
165-
}
166-
167152
impl fmt::Display for EnergyModel {
168153
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
169154
for (_, pd) in self.perf_doms.iter() {

0 commit comments

Comments
 (0)