Skip to content

Commit 20c2d03

Browse files
sbernauerxeniape
andauthored
Apply suggestions from code review
Co-authored-by: Xenia <xeniafischer@hotmail.de>
1 parent 1b52066 commit 20c2d03

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ impl ProbeBuilder<ProbeAction, Duration> {
194194

195195
// SAFETY: Period is checked above to be non-zero
196196
let success_threshold = success_threshold_duration.div_duration_f32(*self.period);
197-
// Note: We calculate an f32, which can overflow an i32, so we clamp it to bo in range
197+
// Note: We calculate an f32, which can overflow an i32, so we clamp it to be in range
198198
#[expect(clippy::cast_possible_truncation)]
199199
#[expect(clippy::cast_precision_loss)]
200200
Ok(self.with_success_threshold(success_threshold.ceil().clamp(0.0, i32::MAX as f32) as i32))
@@ -260,7 +260,7 @@ impl ProbeBuilder<ProbeAction, Duration> {
260260

261261
// SAFETY: Period is checked above to be non-zero
262262
let failure_threshold = failure_threshold_duration.div_duration_f32(*self.period);
263-
// Note: We calculate an f32, which can overflow an i32, so we clamp it to bo in range
263+
// Note: We calculate an f32, which can overflow an i32, so we clamp it to be in range
264264
#[expect(clippy::cast_possible_truncation)]
265265
#[expect(clippy::cast_precision_loss)]
266266
Ok(self.with_failure_threshold(failure_threshold.ceil().clamp(0.0, i32::MAX as f32) as i32))

crates/stackable-operator/src/kvp/key.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,8 @@ impl<T> PartialEq<T> for KeyPrefix
248248
where
249249
T: AsRef<str>,
250250
{
251-
// Not sure how to write that differently without getting a warning about recursion
252-
#[expect(clippy::explicit_deref_methods)]
253251
fn eq(&self, other: &T) -> bool {
254-
self.deref() == other.as_ref()
252+
&**self == other.as_ref()
255253
}
256254
}
257255

@@ -334,10 +332,8 @@ impl<T> PartialEq<T> for KeyName
334332
where
335333
T: AsRef<str>,
336334
{
337-
// Not sure how to write that differently without getting a warning about recursion
338-
#[expect(clippy::explicit_deref_methods)]
339335
fn eq(&self, other: &T) -> bool {
340-
self.deref() == other.as_ref()
336+
&**self == other.as_ref()
341337
}
342338
}
343339

0 commit comments

Comments
 (0)