Skip to content

Commit 2324fec

Browse files
committed
clippy::derive_partial_eq_without_eq
1 parent 7b70c66 commit 2324fec

20 files changed

Lines changed: 54 additions & 50 deletions

File tree

crates/stackable-operator/src/builder/meta.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::kvp::{Annotation, Annotations, Label, LabelError, Labels, ObjectLabel
77

88
type Result<T, E = Error> = std::result::Result<T, E>;
99

10-
#[derive(Debug, PartialEq, Snafu)]
10+
#[derive(Debug, PartialEq, Eq, Snafu)]
1111
pub enum Error {
1212
#[snafu(display("failed to set recommended labels"))]
1313
RecommendedLabels { source: LabelError },

crates/stackable-operator/src/builder/pdb.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use crate::{
1515

1616
type Result<T, E = Error> = std::result::Result<T, E>;
1717

18-
#[derive(Debug, PartialEq, Snafu)]
18+
#[derive(Debug, PartialEq, Eq, Snafu)]
1919
pub enum Error {
2020
#[snafu(display("failed to create role selector labels"))]
2121
RoleSelectorLabels { source: crate::kvp::LabelError },

crates/stackable-operator/src/builder/pod/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub mod volume;
3636

3737
type Result<T, E = Error> = std::result::Result<T, E>;
3838

39-
#[derive(Debug, PartialEq, Snafu)]
39+
#[derive(Debug, PartialEq, Eq, Snafu)]
4040
pub enum Error {
4141
#[snafu(display("termination grace period is too long (got {duration}, maximum allowed is {max})", max = Duration::from_secs(i64::MAX as u64)))]
4242
TerminationGracePeriodTooLong {

crates/stackable-operator/src/builder/pod/volume.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ pub enum VolumeSource {
4141

4242
impl Default for VolumeSource {
4343
fn default() -> Self {
44-
Self::EmptyDir(EmptyDirVolumeSource {
45-
..EmptyDirVolumeSource::default()
46-
})
44+
Self::EmptyDir(EmptyDirVolumeSource::default())
4745
}
4846
}
4947

@@ -267,7 +265,7 @@ impl VolumeMountBuilder {
267265
}
268266
}
269267

270-
#[derive(Debug, PartialEq, Snafu)]
268+
#[derive(Debug, PartialEq, Eq, Snafu)]
271269
pub enum SecretOperatorVolumeSourceBuilderError {
272270
#[snafu(display("failed to parse secret operator volume annotation"))]
273271
ParseAnnotation { source: AnnotationError },
@@ -440,7 +438,7 @@ impl ListenerReference {
440438

441439
// NOTE (Techassi): We might want to think about these names and how long they
442440
// are getting.
443-
#[derive(Debug, PartialEq, Snafu)]
441+
#[derive(Debug, PartialEq, Eq, Snafu)]
444442
pub enum ListenerOperatorVolumeSourceBuilderError {
445443
#[snafu(display("failed to convert listener reference into Kubernetes annotation"))]
446444
ListenerReferenceAnnotation { source: AnnotationError },
@@ -490,10 +488,7 @@ pub struct ListenerOperatorVolumeSourceBuilder {
490488

491489
impl ListenerOperatorVolumeSourceBuilder {
492490
/// Create a builder for the given listener class or listener name
493-
pub fn new(
494-
listener_reference: &ListenerReference,
495-
labels: &Labels,
496-
) -> Self {
491+
pub fn new(listener_reference: &ListenerReference, labels: &Labels) -> Self {
497492
Self {
498493
listener_reference: listener_reference.to_owned(),
499494
labels: labels.to_owned(),

crates/stackable-operator/src/cluster_resources.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,8 @@ impl ClusterResourceApplyStrategy {
205205
/// Indicates if orphaned resources should be deleted depending on the strategy.
206206
const fn delete_orphans(&self) -> bool {
207207
match self {
208-
Self::NoApply
209-
| Self::ReconciliationPaused => false,
210-
Self::ClusterStopped
211-
| Self::Default => true,
208+
Self::NoApply | Self::ReconciliationPaused => false,
209+
Self::ClusterStopped | Self::Default => true,
212210
}
213211
}
214212
}
@@ -261,14 +259,10 @@ impl ClusterResource for DaemonSet {
261259
spec: Some(DaemonSetSpec {
262260
template: PodTemplateSpec {
263261
spec: Some(PodSpec {
264-
node_selector: Some(
265-
[(
266-
"stackable.tech/do-not-schedule".to_string(),
267-
"cluster-stopped".to_string(),
268-
)]
269-
.into_iter()
270-
.collect::<BTreeMap<String, String>>(),
271-
),
262+
node_selector: Some(BTreeMap::from([(
263+
"stackable.tech/do-not-schedule".to_string(),
264+
"cluster-stopped".to_string(),
265+
)])),
272266
..self
273267
.spec
274268
.clone()

crates/stackable-operator/src/commons/networking.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ impl HostName {
143143
}
144144

145145
/// A validated kerberos realm name type, for use in CRDs.
146-
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
146+
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
147147
#[serde(try_from = "String", into = "String")]
148148
pub struct KerberosRealmName(
149149
// Note: Starting with schemars 1.0 and kube 2.0, this pattern is missing in the CRD

crates/stackable-operator/src/commons/pdb.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use serde::{Deserialize, Serialize};
88
///
99
/// Learn more in the
1010
/// [allowed Pod disruptions documentation](DOCS_BASE_URL_PLACEHOLDER/concepts/operations/pod_disruptions).
11-
#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize)]
11+
#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Eq, Serialize)]
1212
#[serde(rename_all = "camelCase")]
1313
pub struct PdbConfig {
1414
/// Whether a PodDisruptionBudget should be written out for this role.

crates/stackable-operator/src/commons/rbac.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use crate::{
1212

1313
type Result<T, E = Error> = std::result::Result<T, E>;
1414

15-
#[derive(Debug, PartialEq, Snafu)]
15+
#[derive(Debug, PartialEq, Eq, Snafu)]
1616
pub enum Error {
1717
#[snafu(display("failed to set owner reference from resource for ServiceAccount {name:?}"))]
1818
ServiceAccountOwnerReferenceFromResource {

crates/stackable-operator/src/commons/secret_class.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::builder::pod::volume::{
77
SecretOperatorVolumeSourceBuilder, SecretOperatorVolumeSourceBuilderError, VolumeBuilder,
88
};
99

10-
#[derive(Debug, PartialEq, Snafu)]
10+
#[derive(Debug, PartialEq, Eq, Snafu)]
1111
pub enum SecretClassVolumeError {
1212
#[snafu(display("failed to build secret operator volume"))]
1313
SecretOperatorVolume {

crates/stackable-operator/src/cpu.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use snafu::{ResultExt, Snafu};
1111

1212
pub type Result<T, E = Error> = std::result::Result<T, E>;
1313

14-
#[derive(Debug, PartialEq, Snafu)]
14+
#[derive(Debug, PartialEq, Eq, Snafu)]
1515
pub enum Error {
1616
#[snafu(display(
1717
"unsupported precision {value:?}. Kubernetes doesn't allow you to specify CPU resources with a precision finer than 1m. Because of this, it's useful to specify CPU units less than 1.0 or 1000m using the milliCPU form; for example, 5m rather than 0.005"
@@ -37,7 +37,7 @@ pub enum Error {
3737
/// A CPU quantity cannot have a precision finer than 'm' (millis) in Kubernetes.
3838
/// So we use that as our internal representation (see:
3939
/// `<https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu>`).
40-
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd)]
40+
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd)]
4141
pub struct CpuQuantity {
4242
millis: usize,
4343
}

0 commit comments

Comments
 (0)