From d6e43159b2ad1f98491a9058887fc9ddd04387e6 Mon Sep 17 00:00:00 2001 From: Daniel McNab <36049421+DJMcNab@users.noreply.github.com> Date: Fri, 17 Oct 2025 14:20:12 +0100 Subject: [PATCH 1/2] Bump the lint set to v7 See https://github.com/linebender/linebender.github.io/pull/122 --- Cargo.toml | 23 +++++------------------ src/lib.rs | 14 ++++++-------- src/style.rs | 4 ---- 3 files changed, 11 insertions(+), 30 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3ad1f43..ed4a028 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,7 +47,7 @@ serde = { version = "1.0.226", default-features = false, optional = true, featur [lints] rust.unsafe_code = "deny" -# LINEBENDER LINT SET - Cargo.toml - v2 +# LINEBENDER LINT SET - Cargo.toml - v7 # See https://linebender.org/wiki/canonical-lints/ rust.keyword_idents_2024 = "forbid" rust.non_ascii_idents = "forbid" @@ -55,50 +55,37 @@ rust.non_local_definitions = "forbid" rust.unsafe_op_in_unsafe_fn = "forbid" rust.elided_lifetimes_in_paths = "warn" -rust.let_underscore_drop = "warn" rust.missing_debug_implementations = "warn" rust.missing_docs = "warn" -rust.single_use_lifetimes = "warn" rust.trivial_numeric_casts = "warn" -rust.unexpected_cfgs = "warn" -rust.unit_bindings = "warn" rust.unnameable_types = "warn" rust.unreachable_pub = "warn" rust.unused_import_braces = "warn" rust.unused_lifetimes = "warn" rust.unused_macro_rules = "warn" rust.unused_qualifications = "warn" -rust.variant_size_differences = "warn" -clippy.allow_attributes = "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" -clippy.exhaustive_enums = "warn" -clippy.fn_to_numeric_cast_any = "forbid" +clippy.fn_to_numeric_cast_any = "warn" clippy.infinite_loop = "warn" -clippy.large_include_file = "warn" clippy.large_stack_arrays = "warn" -clippy.match_same_arms = "warn" clippy.mismatching_type_param_order = "warn" clippy.missing_assert_message = "warn" -clippy.missing_errors_doc = "warn" clippy.missing_fields_in_debug = "warn" -clippy.missing_panics_doc = "warn" -clippy.partial_pub_fields = "warn" -clippy.return_self_not_must_use = "warn" clippy.same_functions_in_if_condition = "warn" clippy.semicolon_if_nothing_returned = "warn" -clippy.shadow_unrelated = "warn" clippy.should_panic_without_expect = "warn" clippy.todo = "warn" -clippy.trivially_copy_pass_by_ref = "warn" clippy.unseparated_literal_suffix = "warn" clippy.use_self = "warn" -clippy.wildcard_imports = "warn" clippy.cargo_common_metadata = "warn" clippy.negative_feature_names = "warn" diff --git a/src/lib.rs b/src/lib.rs index fbf813e..8ab6458 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -12,19 +12,17 @@ //! [`kurbo`]: https://crates.io/crates/kurbo //! [`color`]: https://crates.io/crates/color -// 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))] #![no_std] -#![expect( - clippy::exhaustive_enums, - reason = "Most of the enums are correctly exhaustive as this is a vocabulary crate." -)] mod blend; mod brush; diff --git a/src/style.rs b/src/style.rs index dda70e4..a95d73d 100644 --- a/src/style.rs +++ b/src/style.rs @@ -65,10 +65,6 @@ impl From for Style { /// This is useful for methods that would like to accept draw styles by reference. Defining /// the type as `impl>` allows accepting types like `&Stroke` or `Fill` /// directly without cloning or allocating. -#[expect( - variant_size_differences, - reason = "We don't expect this enum to be operated on in bulk." -)] #[derive(Debug, Copy, Clone)] pub enum StyleRef<'a> { /// Filled draw operation. From 6f28e44707c0e957b445496f0af24d99c2db037c Mon Sep 17 00:00:00 2001 From: Daniel McNab <36049421+DJMcNab@users.noreply.github.com> Date: Fri, 17 Oct 2025 14:21:06 +0100 Subject: [PATCH 2/2] Bump typos --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16aeaf7..edf71f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -293,4 +293,4 @@ jobs: - uses: actions/checkout@v4 - name: check typos - uses: crate-ci/typos@v1.33.1 + uses: crate-ci/typos@v1.38.1