Skip to content

Commit

Permalink
fix clippy lints (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewgazelka authored May 28, 2024
1 parent f9f7bb1 commit 1c37514
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 6 additions & 1 deletion derive/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,11 @@ impl Derivable for Contiguous {
quote!(),
quote! {
type Int = #integer_ty;

#![allow(clippy::missing_docs_in_private_items)]
const MIN_VALUE: #integer_ty = #min_lit;

#![allow(clippy::missing_docs_in_private_items)]
const MAX_VALUE: #integer_ty = #max_lit;

#[inline]
Expand Down Expand Up @@ -491,6 +495,7 @@ fn generate_checked_bit_pattern_struct(
#repr
#[derive(Clone, Copy, #crate_name::AnyBitPattern)]
#derive_dbg
#[allow(missing_docs)]
pub struct #bits_ty {
#(#field_name: <#field_ty as #crate_name::CheckedBitPattern>::Bits,)*
}
Expand All @@ -499,7 +504,7 @@ fn generate_checked_bit_pattern_struct(
type Bits = #bits_ty;

#[inline]
#[allow(clippy::double_comparisons)]
#[allow(clippy::double_comparisons, unused)]
fn is_valid_bit_pattern(bits: &#bits_ty) -> bool {
#(<#field_ty as #crate_name::CheckedBitPattern>::is_valid_bit_pattern(&{ bits.#field_name }) && )* true
}
Expand Down
5 changes: 1 addition & 4 deletions src/checked.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,7 @@ unsafe impl CheckedBitPattern for bool {

#[inline]
fn is_valid_bit_pattern(bits: &Self::Bits) -> bool {
match *bits {
0 | 1 => true,
_ => false,
}
matches!(*bits, 0 | 1)

Check failure on line 166 in src/checked.rs

View workflow job for this annotation

GitHub Actions / Test Rust 1.34.0 on ubuntu-latest

cannot find macro `matches!` in this scope

Check failure on line 166 in src/checked.rs

View workflow job for this annotation

GitHub Actions / Test Rust 1.34.0 on ubuntu-latest

cannot find macro `matches!` in this scope
}
}

Expand Down

0 comments on commit 1c37514

Please sign in to comment.