mirror of
https://github.com/Lokathor/bytemuck.git
synced 2024-11-23 23:32:24 +00:00
fix clippy lints (#137)
This commit is contained in:
parent
f9f7bb10b3
commit
1c3751410f
@ -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]
|
||||
@ -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,)*
|
||||
}
|
||||
@ -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
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user