@@ -32,7 +32,7 @@ pub enum BitmapError {
3232#[ derive( Debug , Clone , Copy , PartialEq , Eq , Hash ) ]
3333struct BitmapCompression ( u32 ) ;
3434
35- #[ allow ( dead_code) ]
35+ #[ expect ( dead_code) ]
3636impl BitmapCompression {
3737 const RGB : Self = Self ( 0x0000 ) ;
3838 const RLE8 : Self = Self ( 0x0001 ) ;
@@ -48,7 +48,7 @@ impl BitmapCompression {
4848#[ derive( Debug , Clone , Copy , PartialEq , Eq , Hash ) ]
4949struct ColorSpace ( u32 ) ;
5050
51- #[ allow ( dead_code) ]
51+ #[ expect ( dead_code) ]
5252impl ColorSpace {
5353 const CALIBRATED_RGB : Self = Self ( 0x00000000 ) ;
5454 const SRGB : Self = Self ( 0x73524742 ) ;
@@ -60,7 +60,7 @@ impl ColorSpace {
6060#[ derive( Debug , Clone , Copy , PartialEq , Eq , Hash ) ]
6161struct BitmapIntent ( u32 ) ;
6262
63- #[ allow ( dead_code) ]
63+ #[ expect ( dead_code) ]
6464impl BitmapIntent {
6565 const LCS_GM_ABS_COLORIMETRIC : Self = Self ( 0x00000008 ) ;
6666 const LCS_GM_BUSINESS : Self = Self ( 0x00000001 ) ;
@@ -499,7 +499,7 @@ fn rgb_bmp_stride(width: u16, bit_count: u16) -> usize {
499499 debug_assert ! ( bit_count <= 32 ) ;
500500
501501 // No side effects, because u16::MAX * 32 + 31 < u16::MAX * u16::MAX < u32::MAX
502- #[ allow ( clippy:: arithmetic_side_effects) ]
502+ #[ expect ( clippy:: arithmetic_side_effects) ]
503503 {
504504 ( ( ( usize:: from ( width) * usize:: from ( bit_count) ) + 31 ) & !31 ) >> 3
505505 }
@@ -527,7 +527,7 @@ fn bgra_to_top_down_rgba(
527527 } ;
528528
529529 // Per invariants: height * width * dst_n_samples <= 10_000 * 10_000 * 4 < u32::MAX
530- #[ allow ( clippy:: arithmetic_side_effects) ]
530+ #[ expect ( clippy:: arithmetic_side_effects) ]
531531 let dst_bitmap_len = usize:: from ( height) * usize:: from ( width) * dst_n_samples;
532532
533533 // Prevent allocation of huge buffers.
@@ -569,7 +569,7 @@ fn bgra_to_top_down_rgba(
569569 } ;
570570
571571 // Per invariants: width * dst_n_samples <= 10_000 * 4 < u32::MAX
572- #[ allow ( clippy:: arithmetic_side_effects) ]
572+ #[ expect ( clippy:: arithmetic_side_effects) ]
573573 let dst_stride = usize:: from ( width) * dst_n_samples;
574574
575575 let mut dst_bitmap = vec ! [ 0u8 ; dst_bitmap_len] ;
@@ -647,13 +647,13 @@ fn top_down_rgba_to_bottom_up_bgra(
647647 let width = u16:: try_from ( info. width ) . map_err ( |_| BitmapError :: WidthTooBig ) ?;
648648 let height = u16:: try_from ( info. height ) . map_err ( |_| BitmapError :: HeightTooBig ) ?;
649649
650- #[ allow ( clippy:: arithmetic_side_effects) ] // width * 4 <= 10_000 * 4 < u32::MAX
650+ #[ expect ( clippy:: arithmetic_side_effects) ] // width * 4 <= 10_000 * 4 < u32::MAX
651651 let stride = usize:: from ( width) * 4 ;
652652
653653 let src_rows = src_bitmap. chunks_exact ( stride) ;
654654
655655 // As per invariants: stride * height <= width * 4 * height <= 10_000 * 4 * 10_000 <= u32::MAX.
656- #[ allow ( clippy:: arithmetic_side_effects) ]
656+ #[ expect ( clippy:: arithmetic_side_effects) ]
657657 let dst_len = stride * usize:: from ( height) ;
658658 let dst_len = u32:: try_from ( dst_len) . map_err ( |_| BitmapError :: InvalidSize ) ?;
659659
0 commit comments