Skip to content

Commit e4cb88c

Browse files
authored
Bump the lint set to v7 (#150)
See linebender/linebender.github.io#122 Also bumps typos.
1 parent 6957d0a commit e4cb88c

File tree

4 files changed

+12
-31
lines changed

4 files changed

+12
-31
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,4 +293,4 @@ jobs:
293293
- uses: actions/checkout@v4
294294

295295
- name: check typos
296-
uses: crate-ci/typos@v1.33.1
296+
uses: crate-ci/typos@v1.38.1

Cargo.toml

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,58 +47,45 @@ serde = { version = "1.0.226", default-features = false, optional = true, featur
4747
[lints]
4848
rust.unsafe_code = "deny"
4949

50-
# LINEBENDER LINT SET - Cargo.toml - v2
50+
# LINEBENDER LINT SET - Cargo.toml - v7
5151
# See https://linebender.org/wiki/canonical-lints/
5252
rust.keyword_idents_2024 = "forbid"
5353
rust.non_ascii_idents = "forbid"
5454
rust.non_local_definitions = "forbid"
5555
rust.unsafe_op_in_unsafe_fn = "forbid"
5656

5757
rust.elided_lifetimes_in_paths = "warn"
58-
rust.let_underscore_drop = "warn"
5958
rust.missing_debug_implementations = "warn"
6059
rust.missing_docs = "warn"
61-
rust.single_use_lifetimes = "warn"
6260
rust.trivial_numeric_casts = "warn"
63-
rust.unexpected_cfgs = "warn"
64-
rust.unit_bindings = "warn"
6561
rust.unnameable_types = "warn"
6662
rust.unreachable_pub = "warn"
6763
rust.unused_import_braces = "warn"
6864
rust.unused_lifetimes = "warn"
6965
rust.unused_macro_rules = "warn"
7066
rust.unused_qualifications = "warn"
71-
rust.variant_size_differences = "warn"
7267

73-
clippy.allow_attributes = "warn"
68+
clippy.too_many_arguments = "allow"
69+
7470
clippy.allow_attributes_without_reason = "warn"
7571
clippy.cast_possible_truncation = "warn"
7672
clippy.collection_is_never_read = "warn"
73+
clippy.default_trait_access = "warn"
7774
clippy.dbg_macro = "warn"
7875
clippy.debug_assert_with_mut_call = "warn"
7976
clippy.doc_markdown = "warn"
80-
clippy.exhaustive_enums = "warn"
81-
clippy.fn_to_numeric_cast_any = "forbid"
77+
clippy.fn_to_numeric_cast_any = "warn"
8278
clippy.infinite_loop = "warn"
83-
clippy.large_include_file = "warn"
8479
clippy.large_stack_arrays = "warn"
85-
clippy.match_same_arms = "warn"
8680
clippy.mismatching_type_param_order = "warn"
8781
clippy.missing_assert_message = "warn"
88-
clippy.missing_errors_doc = "warn"
8982
clippy.missing_fields_in_debug = "warn"
90-
clippy.missing_panics_doc = "warn"
91-
clippy.partial_pub_fields = "warn"
92-
clippy.return_self_not_must_use = "warn"
9383
clippy.same_functions_in_if_condition = "warn"
9484
clippy.semicolon_if_nothing_returned = "warn"
95-
clippy.shadow_unrelated = "warn"
9685
clippy.should_panic_without_expect = "warn"
9786
clippy.todo = "warn"
98-
clippy.trivially_copy_pass_by_ref = "warn"
9987
clippy.unseparated_literal_suffix = "warn"
10088
clippy.use_self = "warn"
101-
clippy.wildcard_imports = "warn"
10289

10390
clippy.cargo_common_metadata = "warn"
10491
clippy.negative_feature_names = "warn"

src/lib.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,17 @@
1212
//! [`kurbo`]: https://crates.io/crates/kurbo
1313
//! [`color`]: https://crates.io/crates/color
1414
15-
// LINEBENDER LINT SET - lib.rs - v1
15+
// LINEBENDER LINT SET - lib.rs - v4
1616
// See https://linebender.org/wiki/canonical-lints/
17-
// These lints aren't included in Cargo.toml because they
18-
// shouldn't apply to examples and tests
19-
#![warn(unused_crate_dependencies)]
17+
// These lints shouldn't apply to examples or tests.
18+
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
19+
// These lints shouldn't apply to examples.
2020
#![warn(clippy::print_stdout, clippy::print_stderr)]
21+
// Targeting e.g. 32-bit means structs containing usize can give false positives for 64-bit.
22+
#![cfg_attr(target_pointer_width = "64", warn(clippy::trivially_copy_pass_by_ref))]
2123
// END LINEBENDER LINT SET
2224
#![cfg_attr(docsrs, feature(doc_cfg))]
2325
#![no_std]
24-
#![expect(
25-
clippy::exhaustive_enums,
26-
reason = "Most of the enums are correctly exhaustive as this is a vocabulary crate."
27-
)]
2826

2927
mod blend;
3028
mod brush;

src/style.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,6 @@ impl From<Stroke> for Style {
6565
/// This is useful for methods that would like to accept draw styles by reference. Defining
6666
/// the type as `impl<Into<DrawRef>>` allows accepting types like `&Stroke` or `Fill`
6767
/// directly without cloning or allocating.
68-
#[expect(
69-
variant_size_differences,
70-
reason = "We don't expect this enum to be operated on in bulk."
71-
)]
7268
#[derive(Debug, Copy, Clone)]
7369
pub enum StyleRef<'a> {
7470
/// Filled draw operation.

0 commit comments

Comments
 (0)