Skip to content

Commit 3b6e2d7

Browse files
committed
chore: Fix clippy lints
1 parent 18f8722 commit 3b6e2d7

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

rust/operator-binary/src/crd/storage.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,25 +156,23 @@ fn default_number_of_datanode_pvcs() -> Option<u16> {
156156
Some(1)
157157
}
158158

159-
#[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
159+
#[derive(Clone, Debug, Default, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
160160
#[serde(rename_all = "PascalCase")]
161161
pub enum HdfsStorageType {
162162
Archive,
163+
164+
#[default]
163165
Disk,
166+
164167
#[serde(rename = "SSD")]
165168
Ssd,
169+
166170
#[serde(rename = "RAMDisk")]
167171
RamDisk,
168172
}
169173

170174
impl Atomic for HdfsStorageType {}
171175

172-
impl Default for HdfsStorageType {
173-
fn default() -> Self {
174-
Self::Disk
175-
}
176-
}
177-
178176
impl HdfsStorageType {
179177
pub fn as_hdfs_config_literal(&self) -> &str {
180178
match self {

rust/operator-binary/src/event.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub fn build_invalid_replica_message(
6060
Some(format!(
6161
"{role_name}: only has {replicas} replicas configured, it is strongly recommended to use at least [{min_replicas}]"
6262
))
63-
} else if !role.replicas_can_be_even() && replicas % 2 == 0 {
63+
} else if !role.replicas_can_be_even() && replicas.is_multiple_of(2) {
6464
Some(format!(
6565
"{role_name}: currently has an even number of replicas [{replicas}], but should always have an odd number to ensure quorum"
6666
))

0 commit comments

Comments
 (0)