diff --git a/rust/Dockerfile b/rust/Dockerfile index ea6921be1..e8cbb7389 100644 --- a/rust/Dockerfile +++ b/rust/Dockerfile @@ -1,5 +1,5 @@ # Keep synced with `rust-toolchain.toml` -ARG RUST_VERSION="1.85.0" +ARG RUST_VERSION="1.86.0" ARG ALPINE_VERSION="3.20" ARG CARGO_CHEF_VERSION="0.1.67" diff --git a/rust/connlib/tunnel/src/client.rs b/rust/connlib/tunnel/src/client.rs index 46e04254e..baac41ea6 100644 --- a/rust/connlib/tunnel/src/client.rs +++ b/rust/connlib/tunnel/src/client.rs @@ -76,7 +76,7 @@ const IDS_EXPIRE: std::time::Duration = std::time::Duration::from_secs(60); /// /// 100 has been chosen as a pretty arbitrary value. /// We only store [`GatewayId`]s so the memory footprint is negligible. -const MAX_REMEMBERED_GATEWAYS: NonZeroUsize = unsafe { NonZeroUsize::new_unchecked(100) }; +const MAX_REMEMBERED_GATEWAYS: NonZeroUsize = NonZeroUsize::new(100).expect("100 > 0"); /// How many concurrent TCP DNS clients we can server _per_ sentinel DNS server IP. const NUM_CONCURRENT_TCP_DNS_CLIENTS: usize = 10; diff --git a/rust/gui-client/src-common/src/updates.rs b/rust/gui-client/src-common/src/updates.rs index dc03731d7..ffbd33b51 100644 --- a/rust/gui-client/src-common/src/updates.rs +++ b/rust/gui-client/src-common/src/updates.rs @@ -262,7 +262,7 @@ fn parse_version_from_url(url: &Url) -> Result { let filename = url .path_segments() .context("URL must have a path")? - .last() + .next_back() .context("URL path must have a last segment")?; let version_str = filename .split('_') diff --git a/rust/logging/src/format.rs b/rust/logging/src/format.rs index 527c89465..acebd44f1 100644 --- a/rust/logging/src/format.rs +++ b/rust/logging/src/format.rs @@ -63,10 +63,7 @@ impl Default for Format { const TIMESTAMP_FORMAT_CONFIG: EncodedConfig = Config::DEFAULT .set_time_precision(TimePrecision::Second { - decimal_digits: Some({ - // Safety: 3 > 0 - unsafe { NonZeroU8::new_unchecked(3) } - }), + decimal_digits: Some(NonZeroU8::new(3).expect("3 > 0")), }) .encode(); diff --git a/rust/rust-toolchain.toml b/rust/rust-toolchain.toml index 4c555821c..7c097685e 100644 --- a/rust/rust-toolchain.toml +++ b/rust/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] # Keep synced with `Dockerfile` -channel = "1.85.0" +channel = "1.86.0" components = ["rust-src", "rust-analyzer", "clippy"] targets = ["x86_64-unknown-linux-musl"]