Skip to content

Commit e67e1df

Browse files
committed
chore: bump Rust edition to 2024 and apply cargo fix + clippy updates
Run `cargo fix --edition`: - Fix Rust 2024 temporary drop order change in tail expression by adding a trailing semicolon to the controller match block in hdfs_clusterrolebinding_nodes_controller.rs - Add use<> (auto refactor by cargo fix) Clippy refactor: - Simplify nested conditions
1 parent 8c7f91b commit e67e1df

5 files changed

Lines changed: 17 additions & 16 deletions

File tree

Cargo.nix

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ resolver = "2"
66
version = "0.0.0-dev"
77
authors = ["Stackable GmbH <info@stackable.tech>"]
88
license = "OSL-3.0"
9-
edition = "2021"
9+
edition = "2024"
1010
repository = "https://github.com/stackabletech/hdfs-operator"
1111

1212
[workspace.dependencies]

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

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ impl v1alpha1::HdfsCluster {
617617
(
618618
Vec<PropertyNameKind>,
619619
Role<
620-
impl Configuration<Configurable = v1alpha1::HdfsCluster>,
620+
impl Configuration<Configurable = v1alpha1::HdfsCluster> + use<>,
621621
v1alpha1::HdfsConfigOverrides,
622622
GenericRoleConfig,
623623
JavaCommonConfig,
@@ -1412,10 +1412,10 @@ impl Configuration for NameNodeConfigFragment {
14121412
// If rack awareness is configured, insert the labels into an env var to configure
14131413
// the topology-provider and add the artifact to the classpath.
14141414
// This is only needed on namenodes.
1415-
if role_name == HdfsNodeRole::Name.to_string() {
1416-
if let Some(awareness_config) = resource.rackawareness_config() {
1417-
result.insert("TOPOLOGY_LABELS".to_string(), Some(awareness_config));
1418-
}
1415+
if role_name == HdfsNodeRole::Name.to_string()
1416+
&& let Some(awareness_config) = resource.rackawareness_config()
1417+
{
1418+
result.insert("TOPOLOGY_LABELS".to_string(), Some(awareness_config));
14191419
}
14201420
Ok(result)
14211421
}
@@ -1440,13 +1440,14 @@ impl Configuration for NameNodeConfigFragment {
14401440
DFS_REPLICATION.to_string(),
14411441
Some(resource.spec.cluster_config.dfs_replication.to_string()),
14421442
);
1443-
} else if file == CORE_SITE_XML && role_name == HdfsNodeRole::Name.to_string() {
1444-
if let Some(_awareness_config) = resource.rackawareness_config() {
1445-
config.insert(
1446-
"net.topology.node.switch.mapping.impl".to_string(),
1447-
Some("tech.stackable.hadoop.StackableTopologyProvider".to_string()),
1448-
);
1449-
}
1443+
} else if file == CORE_SITE_XML
1444+
&& role_name == HdfsNodeRole::Name.to_string()
1445+
&& let Some(_awareness_config) = resource.rackawareness_config()
1446+
{
1447+
config.insert(
1448+
"net.topology.node.switch.mapping.impl".to_string(),
1449+
Some("tech.stackable.hadoop.StackableTopologyProvider".to_string()),
1450+
);
14501451
}
14511452

14521453
Ok(config)

rust/operator-binary/src/hdfs_clusterrolebinding_nodes_controller.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,5 @@ pub async fn reconcile(
105105
&patch
106106
),
107107
Err(e) => error!("{}", e),
108-
}
108+
};
109109
}

rust/operator-binary/src/webhooks/conversion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub async fn create_webhook_server(
3737
field_manager: FIELD_MANAGER.to_owned(),
3838
};
3939

40-
let (conversion_webhook, _initial_reconcile_rx) =
40+
let (conversion_webhook, _) =
4141
ConversionWebhook::new(crds_and_handlers, client, conversion_webhook_options);
4242

4343
let webhook_server_options = WebhookServerOptions {

0 commit comments

Comments
 (0)