Skip to content

Commit e6baff4

Browse files
authored
[meta] migrate to 2024 edition (#9398)
Did this by: * running `cargo fix --edition` * manually reverting the changes from `match` to `if let` * inspecting the rest of the changes Due to drop order changes outlined [here](https://doc.rust-lang.org/edition-guide/rust-2024/temporary-tail-expr-scope.html) and [here](https://doc.rust-lang.org/edition-guide/rust-2024/temporary-if-let-scope.html), this change is not as risk-free as I would like (potentially causing future cancellation issues, or maybe resolving latent ones). But hopefully a full release cycle would be enough time to bake these changes.
1 parent 8a4860b commit e6baff4

File tree

273 files changed

+698
-634
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

273 files changed

+698
-634
lines changed

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,9 @@ default-members = [
321321
]
322322
resolver = "3"
323323

324+
[workspace.package]
325+
edition = "2024"
326+
324327
#
325328
# Tree-wide lint configuration.
326329
# https://doc.rust-lang.org/stable/cargo/reference/manifest.html#the-lints-section

api_identity/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "api_identity"
33
description = "macro used for Oxide control plane resources with an identity"
44
version = "0.1.0"
55
authors = ["David Pacheco <[email protected]>"]
6-
edition = "2021"
6+
edition.workspace = true
77
repository = "https://github.com/oxidecomputer/omicron/"
88
license = "MPL-2.0"
99

bootstore/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "bootstore"
33
description = "Storage required for rack unlock"
44
version = "0.1.0"
5-
edition = "2021"
5+
edition.workspace = true
66
license = "MPL-2.0"
77

88
[build-dependencies]

certificates/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "omicron-certificates"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition.workspace = true
55
license = "MPL-2.0"
66

77
[lints]

certificates/src/openssl_ext.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use std::ffi::c_int;
1616
use std::ffi::c_uint;
1717
use std::ptr;
1818

19-
extern "C" {
19+
unsafe extern "C" {
2020
// `X509_check_host()` is only exported by `openssl-sys` if the `bindgen`
2121
// feature is enabled
2222
// (https://github.com/sfackler/rust-openssl/issues/2041). For now, we'll

clickhouse-admin/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "omicron-clickhouse-admin"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition.workspace = true
55
license = "MPL-2.0"
66

77
[dependencies]

clickhouse-admin/api/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "clickhouse-admin-api"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition.workspace = true
55
license = "MPL-2.0"
66

77
[lints]

clickhouse-admin/src/context.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ impl KeeperServerContext {
5050

5151
// If there is already a configuration file with a generation number we'll
5252
// use that. Otherwise, we set the generation number to None.
53-
let gen = read_generation_from_file(config_path)?;
54-
let (generation_tx, generation_rx) = watch::channel(gen);
53+
let generation = read_generation_from_file(config_path)?;
54+
let (generation_tx, generation_rx) = watch::channel(generation);
5555

5656
// We only want to handle one in flight request at a time. Reconfigurator execution will retry
5757
// again later anyway. We use flume bounded channels with a size of 0 to act as a rendezvous channel.
@@ -137,8 +137,8 @@ impl ServerContext {
137137

138138
// If there is already a configuration file with a generation number we'll
139139
// use that. Otherwise, we set the generation number to None.
140-
let gen = read_generation_from_file(config_path)?;
141-
let (generation_tx, generation_rx) = watch::channel(gen);
140+
let generation = read_generation_from_file(config_path)?;
141+
let (generation_tx, generation_rx) = watch::channel(generation);
142142

143143
// We only want to handle one in flight request at a time. Reconfigurator execution will retry
144144
// again later anyway. We use flume bounded channels with a size of 0 to act as a rendezvous channel.
@@ -499,9 +499,9 @@ fn read_generation_from_file(path: Utf8PathBuf) -> Result<Option<Generation>> {
499499
)
500500
})?;
501501

502-
let gen = Generation::try_from(gen_u64)?;
502+
let generation = Generation::try_from(gen_u64)?;
503503

504-
Ok(Some(gen))
504+
Ok(Some(generation))
505505
}
506506

507507
#[cfg(test)]

clickhouse-admin/src/http_entrypoints.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ impl ClickhouseAdminServerApi for ClickhouseAdminServerImpl {
5454
rqctx: RequestContext<Self::Context>,
5555
) -> Result<HttpResponseOk<Generation>, HttpError> {
5656
let ctx = rqctx.context();
57-
let gen = match ctx.generation() {
57+
let generation = match ctx.generation() {
5858
Some(g) => g,
5959
None => {
6060
return Err(HttpError::for_client_error(
@@ -64,7 +64,7 @@ impl ClickhouseAdminServerApi for ClickhouseAdminServerImpl {
6464
));
6565
}
6666
};
67-
Ok(HttpResponseOk(gen))
67+
Ok(HttpResponseOk(generation))
6868
}
6969

7070
async fn distributed_ddl_queue(
@@ -120,7 +120,7 @@ impl ClickhouseAdminKeeperApi for ClickhouseAdminKeeperImpl {
120120
rqctx: RequestContext<Self::Context>,
121121
) -> Result<HttpResponseOk<Generation>, HttpError> {
122122
let ctx = rqctx.context();
123-
let gen = match ctx.generation() {
123+
let generation = match ctx.generation() {
124124
Some(g) => g,
125125
None => {
126126
return Err(HttpError::for_client_error(
@@ -130,7 +130,7 @@ impl ClickhouseAdminKeeperApi for ClickhouseAdminKeeperImpl {
130130
));
131131
}
132132
};
133-
Ok(HttpResponseOk(gen))
133+
Ok(HttpResponseOk(generation))
134134
}
135135

136136
async fn lgif(

clickhouse-admin/test-utils/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "clickhouse-admin-test-utils"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition.workspace = true
55
license = "MPL-2.0"
66

77
[lints]

0 commit comments

Comments
 (0)