Skip to content

Commit cce4ee7

Browse files
committed
chore: Use Rust 2024 edition
1 parent 91beab2 commit cce4ee7

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[workspace]
22
members = ["crates/*"]
3-
resolver = "2"
3+
resolver = "3"
44

55
[workspace.package]
66
authors = ["Stackable GmbH <[email protected]>"]
77
license = "Apache-2.0"
8-
edition = "2021"
8+
edition = "2024"
99
repository = "https://github.com/stackabletech/operator-rs"
1010

1111
[workspace.dependencies]

crates/stackable-operator/src/cli.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ mod tests {
381381
#[test]
382382
fn product_operator_run_watch_namespace() {
383383
// clean env var to not interfere if already set
384-
env::remove_var(WATCH_NAMESPACE);
384+
unsafe { env::remove_var(WATCH_NAMESPACE) };
385385

386386
// cli with namespace
387387
let opts = ProductOperatorRun::parse_from([
@@ -414,7 +414,7 @@ mod tests {
414414
);
415415

416416
// env with namespace
417-
env::set_var(WATCH_NAMESPACE, "foo");
417+
unsafe { env::set_var(WATCH_NAMESPACE, "foo") };
418418
let opts = ProductOperatorRun::parse_from(["run", "--product-config", "bar"]);
419419
assert_eq!(
420420
opts,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ impl JsonSchema for HostName {
7979
"HostName".to_owned()
8080
}
8181

82-
fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
83-
String::json_schema(gen)
82+
fn json_schema(generator: &mut schemars::r#gen::SchemaGenerator) -> schemars::schema::Schema {
83+
String::json_schema(generator)
8484
}
8585
}
8686

crates/stackable-operator/src/product_config_utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,11 +521,11 @@ where
521521
mod tests {
522522
macro_rules! collection {
523523
// map-like
524-
($($k:expr => $v:expr),* $(,)?) => {
524+
($($k:expr_2021 => $v:expr_2021),* $(,)?) => {
525525
[$(($k, $v),)*].into()
526526
};
527527
// set-like
528-
($($v:expr),* $(,)?) => {
528+
($($v:expr_2021),* $(,)?) => {
529529
[$($v,)*].into()
530530
};
531531
}

crates/stackable-operator/src/time/duration.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ impl JsonSchema for Duration {
170170
"Duration".to_string()
171171
}
172172

173-
fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
174-
String::json_schema(gen)
173+
fn json_schema(generator: &mut schemars::r#gen::SchemaGenerator) -> schemars::schema::Schema {
174+
String::json_schema(generator)
175175
}
176176
}
177177

crates/stackable-operator/src/utils/crds.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
use schemars::schema::Schema;
22

3-
pub fn raw_object_schema(_: &mut schemars::gen::SchemaGenerator) -> Schema {
3+
pub fn raw_object_schema(_: &mut schemars::r#gen::SchemaGenerator) -> Schema {
44
serde_json::from_value(serde_json::json!({
55
"type": "object",
66
"x-kubernetes-preserve-unknown-fields": true,
77
}))
88
.expect("Failed to parse JSON of custom raw object schema")
99
}
1010

11-
pub fn raw_optional_object_schema(_: &mut schemars::gen::SchemaGenerator) -> Schema {
11+
pub fn raw_optional_object_schema(_: &mut schemars::r#gen::SchemaGenerator) -> Schema {
1212
serde_json::from_value(serde_json::json!({
1313
"type": "object",
1414
"nullable": true,
@@ -17,7 +17,7 @@ pub fn raw_optional_object_schema(_: &mut schemars::gen::SchemaGenerator) -> Sch
1717
.expect("Failed to parse JSON of custom optional raw object schema")
1818
}
1919

20-
pub fn raw_object_list_schema(_: &mut schemars::gen::SchemaGenerator) -> Schema {
20+
pub fn raw_object_list_schema(_: &mut schemars::r#gen::SchemaGenerator) -> Schema {
2121
serde_json::from_value(serde_json::json!({
2222
"type": "array",
2323
"items": {

crates/stackable-versioned-macros/src/attrs/item/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ impl CommonItemAttributes {
163163
// Now, iterate over all changes and ensure that their versions are
164164
// between the added and deprecated version.
165165
if !self.changes.iter().all(|r| {
166-
added_version.map_or(true, |a| a < *r.since)
167-
&& deprecated_version.map_or(true, |d| d > *r.since)
166+
added_version.is_none_or(|a| a < *r.since)
167+
&& deprecated_version.is_none_or(|d| d > *r.since)
168168
}) {
169169
return Err(Error::custom(
170170
"all changes must use versions higher than `added` and lower than `deprecated`",

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[toolchain]
2-
channel = "1.84.1"
2+
channel = "1.85.0"

0 commit comments

Comments
 (0)