From 72b13dd6865f1c4c4236af8facc089cdac221484 Mon Sep 17 00:00:00 2001 From: Rinde van Lon Date: Thu, 10 Oct 2024 13:49:27 +0100 Subject: [PATCH] chore: update to rust 1.81.0 (#68) --- Cargo.toml | 19 +++++++++++------- rust-toolchain-nightly.toml | 2 +- rust-toolchain.toml | 2 +- src/lib.rs | 40 +++++++++++++++++++------------------ 4 files changed, 35 insertions(+), 28 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1cf3975..205ef99 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,23 +42,28 @@ unused_macro_rules = "warn" unused_qualifications = "warn" unused_results = "warn" dead_code = "warn" -unused = "warn" +unused = { level = "warn", priority = -1 } [lints.rustdoc] broken_intra_doc_links = "deny" missing_crate_level_docs = "warn" [lints.clippy] -cargo = "allow" # TODO -complexity = "warn" -correctness = "deny" -perf = "warn" -style = "warn" -suspicious = "deny" +complexity = { level = "warn", priority = -1 } +correctness = { level = "deny", priority = -1 } +perf = { level = "warn", priority = -1 } +style = { level = "warn", priority = -1 } +suspicious = { level = "deny", priority = -1 } + +cargo = { level = "allow", priority = -1 } # TODO todo = "warn" +disallowed-types = "deny" missing_const_for_fn = "warn" +allow_attributes = "deny" +allow_attributes_without_reason = "deny" + ### Pedantic pedantic = { level = "warn", priority = -1 } missing_errors_doc = "allow" # TODO diff --git a/rust-toolchain-nightly.toml b/rust-toolchain-nightly.toml index 3c7c25c..74f46e1 100644 --- a/rust-toolchain-nightly.toml +++ b/rust-toolchain-nightly.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-21" +channel = "nightly-2024-09-06" diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 83025f9..1de01fa 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.77.0" +channel = "1.81.0" diff --git a/src/lib.rs b/src/lib.rs index 726b7d1..f65afbc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,3 @@ -#![allow(rustdoc::private_intra_doc_links)] -#![deny(rustdoc::broken_intra_doc_links)] -#![warn(clippy::disallowed_types)] - //! Low overhead implementation of time related concepts. //! //! # Operator support @@ -141,9 +137,10 @@ impl Time { pub fn format<'a>(&self, fmt: &'a str) -> DelayedFormat> { let secs = self.0 / 1000; let nanos = (self.0 % 1000) * 1_000_000; - // casting to u32 is safe here because it is guaranteed that the value is in - // 0..1_000_000_000 - #[allow(clippy::cast_possible_truncation)] + #[expect( + clippy::cast_possible_truncation, + reason = "casting to u32 is safe here because it is guaranteed that the value is in 0..1_000_000_000" + )] let nanos = if nanos.is_negative() { 1_000_000_000 - nanos.unsigned_abs() } else { @@ -366,7 +363,10 @@ impl From