Skip to content

Commit 2bdaa35

Browse files
committed
fix: Fix new Clippy errors introduced in Rust 1.80.0
1 parent 98eac93 commit 2bdaa35

File tree

6 files changed

+40
-29
lines changed

6 files changed

+40
-29
lines changed

crates/stackable-operator/src/client.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -373,15 +373,15 @@ impl Client {
373373

374374
/// There are four different patch strategies:
375375
/// 1) Apply (<https://kubernetes.io/docs/reference/using-api/api-concepts/#server-side-apply>)
376-
/// Starting from Kubernetes v1.18, you can enable the Server Side Apply feature so that the control plane tracks managed fields for all newly created objects.
376+
/// Starting from Kubernetes v1.18, you can enable the Server Side Apply feature so that the control plane tracks managed fields for all newly created objects.
377377
/// 2) Json (<https://tools.ietf.org/html/rfc6902>):
378-
/// This is supported on crate feature jsonpatch only
378+
/// This is supported on crate feature jsonpatch only
379379
/// 3) Merge (<https://tools.ietf.org/html/rfc7386>):
380-
/// For example, if you want to update a list you have to specify the complete list and update everything
380+
/// For example, if you want to update a list you have to specify the complete list and update everything
381381
/// 4) Strategic (not for CustomResource)
382-
/// With a strategic merge patch, a list is either replaced or merged depending on its patch strategy.
383-
/// The patch strategy is specified by the value of the patchStrategy key in a field tag in the Kubernetes source code.
384-
/// For example, the Containers field of PodSpec struct has a patchStrategy of merge.
382+
/// With a strategic merge patch, a list is either replaced or merged depending on its patch strategy.
383+
/// The patch strategy is specified by the value of the patchStrategy key in a field tag in the Kubernetes source code.
384+
/// For example, the Containers field of PodSpec struct has a patchStrategy of merge.
385385
async fn patch_status<T, S>(
386386
&self,
387387
resource: &T,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ pub enum KubernetesTrafficPolicy {
110110
/// 1. It uses a cluster-level policy object (ListenerClass) to define how exactly the exposure works
111111
/// 2. It has a consistent API for reading back the exposed address(es) of the service
112112
/// 3. The Pod must mount a Volume referring to the Listener, which also allows
113-
/// ["sticky" scheduling](DOCS_BASE_URL_PLACEHOLDER/listener-operator/listener#_sticky_scheduling).
113+
/// ["sticky" scheduling](DOCS_BASE_URL_PLACEHOLDER/listener-operator/listener#_sticky_scheduling).
114114
///
115115
/// Learn more in the [Listener documentation](DOCS_BASE_URL_PLACEHOLDER/listener-operator/listener).
116116
#[derive(

crates/stackable-operator/src/cpu.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,14 @@ impl Display for CpuQuantity {
101101
impl FromStr for CpuQuantity {
102102
type Err = Error;
103103

104-
/// Only two formats can be parsed
104+
/// Only two formats can be parsed:
105+
///
105106
/// - {usize}m
106107
/// - {f32}
107-
/// For the float, only milli-precision is supported.
108-
/// Using more precise values will trigger an error, and using any other
109-
/// unit than 'm' or None will also trigger an error.
108+
///
109+
/// For the float, only milli-precision is supported. Using more precise
110+
/// values will trigger an error, and using any other unit than 'm' or None
111+
/// will also trigger an error.
110112
fn from_str(q: &str) -> Result<Self> {
111113
let start_of_unit = q.find(|c: char| c != '.' && !c.is_numeric());
112114
if let Some(start_of_unit) = start_of_unit {

crates/stackable-operator/src/memory.rs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Utilities for converting Kubernetes quantities to Java heap settings.
22
//! Since Java heap sizes are a subset of Kubernetes quantities, the conversion
3-
//! might lose precision or fail completely.
4-
//! In addition:
3+
//! might lose precision or fail completely. In addition:
4+
//!
55
//! - decimal quantities are not supported ("2G" is invalid)
66
//! - units are case sensitive ("2gi" is invalid)
77
//! - exponential notation is not supported.
@@ -121,12 +121,15 @@ impl Display for BinaryMultiple {
121121
}
122122

123123
/// Convert a (memory) [`Quantity`] to Java heap settings.
124+
///
124125
/// Quantities are usually passed on to container resources while Java heap
125-
/// sizes need to be scaled accordingly.
126-
/// This implements a very simple heuristic to ensure that:
126+
/// sizes need to be scaled accordingly. This implements a very simple heuristic
127+
/// to ensure that:
128+
///
127129
/// - the quantity unit has been mapped to a java supported heap unit. Java only
128130
/// supports up to Gibibytes while K8S quantities can be expressed in Exbibytes.
129131
/// - the heap size has a non-zero value.
132+
///
130133
/// Fails if it can't enforce the above restrictions.
131134
#[deprecated(
132135
since = "0.33.0",
@@ -148,15 +151,17 @@ pub fn to_java_heap(q: &Quantity, factor: f32) -> Result<String> {
148151
}
149152

150153
/// Convert a (memory) [`Quantity`] to a raw Java heap value of the desired `target_unit`.
154+
///
151155
/// Quantities are usually passed on to container resources while Java heap
152-
/// sizes need to be scaled accordingly.
153-
/// The raw heap value is converted to the specified `target_unit` (this conversion
154-
/// is done even if specified a unit greater that Gibibytes. It is not recommended to scale
155-
/// to anything bigger than Gibibytes.
156-
/// This implements a very simple heuristic to ensure that:
156+
/// sizes need to be scaled accordingly. The raw heap value is converted to the
157+
/// specified `target_unit` (this conversion is done even if specified a unit
158+
/// greater that Gibibytes. It is not recommended to scale to anything bigger
159+
/// than Gibibytes. This implements a very simple heuristic to ensure that:
160+
///
157161
/// - the quantity unit has been mapped to a java supported heap unit. Java only
158162
/// supports up to Gibibytes while K8S quantities can be expressed in Exbibytes.
159163
/// - the heap size has a non-zero value.
164+
///
160165
/// Fails if it can't enforce the above restrictions.
161166
#[deprecated(
162167
since = "0.33.0",

crates/stackable-operator/src/status/condition/mod.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -290,16 +290,20 @@ impl ClusterConditionSet {
290290
self.conditions[index] = Some(condition);
291291
}
292292

293-
/// Merges two [`ClusterConditionSet`]s. The condition_combiner implements the strategy used to
294-
/// merge two conditions of the same `type_`.
293+
/// Merges two [`ClusterConditionSet`]s.
294+
///
295+
/// The condition_combiner implements the strategy used to merge two
296+
/// conditions of the same `type_`.
295297
///
296298
/// # Arguments
297299
///
298300
/// * `other` - The [`ClusterConditionSet`] to be merged
299-
/// * `condition_combiner` - This is either be `update_message` or `update_timestamps`. The
300-
/// `update_message` is used to concatenate messages of the same [`ClusterConditionStatus`] and
301-
/// the same [`ClusterConditionType`]. The `update_timestamps` is required to merge the old
302-
/// cluster status with the new one and update transition timestamps correctly.
301+
/// * `condition_combiner` - This is either be `update_message` or
302+
/// `update_timestamps`. The `update_message` is used to concatenate
303+
/// messages of the same [`ClusterConditionStatus`] and the same
304+
/// [`ClusterConditionType`]. The `update_timestamps` is required to merge
305+
/// the old cluster status with the new one and update transition
306+
/// timestamps correctly.
303307
fn merge(
304308
self,
305309
other: ClusterConditionSet,
@@ -361,7 +365,7 @@ fn update_timestamps(
361365
/// A condition combiner strategy with the following properties:
362366
/// 1. It preserves the condition with the highest status.
363367
/// 2. It joins the previous messages to the current one if both conditions
364-
/// have the same status.
368+
/// have the same status.
365369
fn update_message(
366370
old_condition: ClusterCondition,
367371
new_condition: ClusterCondition,

crates/stackable-telemetry/src/instrumentation/axum/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ pub trait RequestExt {
199199
/// section of the HTTP span semantic conventions:
200200
///
201201
/// > HTTP server instrumentations SHOULD do the best effort when populating
202-
/// server.address and server.port attributes and SHOULD determine them by
203-
/// using the first of the following that applies:
202+
/// > server.address and server.port attributes and SHOULD determine them by
203+
/// > using the first of the following that applies:
204204
/// >
205205
/// > - The original host which may be passed by the reverse proxy in the
206206
/// > Forwarded#host, X-Forwarded-Host, or a similar header.

0 commit comments

Comments
 (0)