From 977dc6306cd988b35ca895b7fe01626dfcf577ca Mon Sep 17 00:00:00 2001 From: Daniel McNab <36049421+DJMcNab@users.noreply.github.com> Date: Fri, 17 Oct 2025 14:04:35 +0100 Subject: [PATCH 1/2] Update to lint set v7 Not exactly urgent as there are no changes, but I'm going through the line and re-syncing stuff Also some tweaks in the `color_operations` stub --- Cargo.toml | 5 ++++- color_operations/src/lib.rs | 15 ++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 520b6b5..9043244 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,9 +24,10 @@ color = { version = "0.3.2", path = "color", default-features = false } color_operations = { version = "0.3.2", path = "color_operations" } [workspace.lints] +# This one may vary depending on the project. rust.unsafe_code = "deny" -# LINEBENDER LINT SET - Cargo.toml - v6.1 +# LINEBENDER LINT SET - Cargo.toml - v7 # See https://linebender.org/wiki/canonical-lints/ rust.keyword_idents_2024 = "forbid" rust.non_ascii_idents = "forbid" @@ -42,12 +43,14 @@ rust.unreachable_pub = "warn" rust.unused_import_braces = "warn" rust.unused_lifetimes = "warn" rust.unused_macro_rules = "warn" +rust.unused_qualifications = "warn" clippy.too_many_arguments = "allow" clippy.allow_attributes_without_reason = "warn" clippy.cast_possible_truncation = "warn" clippy.collection_is_never_read = "warn" +clippy.default_trait_access = "warn" clippy.dbg_macro = "warn" clippy.debug_assert_with_mut_call = "warn" clippy.doc_markdown = "warn" diff --git a/color_operations/src/lib.rs b/color_operations/src/lib.rs index 5b17220..fa31dea 100644 --- a/color_operations/src/lib.rs +++ b/color_operations/src/lib.rs @@ -3,15 +3,20 @@ //! # Color Operations -// LINEBENDER LINT SET - lib.rs - v1 +// LINEBENDER LINT SET - lib.rs - v4 // See https://linebender.org/wiki/canonical-lints/ -// These lints aren't included in Cargo.toml because they -// shouldn't apply to examples and tests -#![warn(unused_crate_dependencies)] +// These lints shouldn't apply to examples or tests. +#![cfg_attr(not(test), warn(unused_crate_dependencies))] +// These lints shouldn't apply to examples. #![warn(clippy::print_stdout, clippy::print_stderr)] +// Targeting e.g. 32-bit means structs containing usize can give false positives for 64-bit. +#![cfg_attr(target_pointer_width = "64", warn(clippy::trivially_copy_pass_by_ref))] // END LINEBENDER LINT SET #![cfg_attr(docsrs, feature(doc_cfg))] -#![cfg_attr(all(not(feature = "std"), not(test)), no_std)] +#![no_std] + +#[cfg(feature = "std")] +extern crate std; // Temporary to suppress warning. use color as _; From 59a8eece78cc6f148f8439cdadfb1b70d7d2b0e6 Mon Sep 17 00:00:00 2001 From: Daniel McNab <36049421+DJMcNab@users.noreply.github.com> Date: Fri, 17 Oct 2025 14:17:08 +0100 Subject: [PATCH 2/2] Also bump typos and stable rust --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 19a7abf..5fc21c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ env: # version like 1.70. Note that we only specify MAJOR.MINOR and not PATCH so that bugfixes still # come automatically. If the version specified here is no longer the latest stable version, # then please feel free to submit a PR that adjusts it along with the potential clippy fixes. - RUST_STABLE_VER: "1.88" # In quotes because otherwise (e.g.) 1.70 would be interpreted as 1.7 + RUST_STABLE_VER: "1.90" # In quotes because otherwise (e.g.) 1.70 would be interpreted as 1.7 # The purpose of checking with the minimum supported Rust toolchain is to detect its staleness. # If the compilation fails, then the version specified here needs to be bumped up to reality. # Be sure to also update the rust-version property in the workspace Cargo.toml file, @@ -346,4 +346,4 @@ jobs: - uses: actions/checkout@v4 - name: check typos - uses: crate-ci/typos@v1.33.1 + uses: crate-ci/typos@v1.38.1