Commit 5414013 1 parent 7495e4b commit 5414013 Copy full SHA for 5414013
File tree 7 files changed +10
-22
lines changed
7 files changed +10
-22
lines changed Original file line number Diff line number Diff line change @@ -19,16 +19,9 @@ allow = [
19
19
" BSD-2-Clause" ,
20
20
" BSD-3-Clause" ,
21
21
" MIT" ,
22
- " MIT-0" ,
23
- " MPL-2.0" ,
24
- " Unicode-DFS-2016" ,
22
+ " Unicode-3.0" ,
25
23
]
26
24
27
- [[licenses .exceptions ]]
28
- allow = [" WTFPL" ]
29
- name = " pcx"
30
- version = " *"
31
-
32
25
[advisories ]
33
26
yanked = " deny"
34
27
ignore = []
@@ -41,5 +34,4 @@ deny = []
41
34
skip = [
42
35
{ name = " bitflags" }, # Some deps depend on 1.3.2 while others on 2.6.0
43
36
{ name = " hashbrown" }, # Some deps depend on 0.13.2 while others on 0.14.5
44
- { name = " miniz_oxide" } # Some deps depend on 0.7.4 while others on 0.8.0
45
37
]
Original file line number Diff line number Diff line change @@ -801,7 +801,7 @@ where
801
801
/// the bounds will not overflow.
802
802
fn check_image_fits ( width : u32 , height : u32 , len : usize ) -> bool {
803
803
let checked_len = Self :: image_buffer_len ( width, height) ;
804
- checked_len. map_or ( false , |min_len| min_len <= len)
804
+ checked_len. is_some_and ( |min_len| min_len <= len)
805
805
}
806
806
807
807
fn image_buffer_len ( width : u32 , height : u32 ) -> Option < usize > {
Original file line number Diff line number Diff line change @@ -528,7 +528,7 @@ fn process_halved_chroma_row<
528
528
// preventing accidental use of invalid values from the trailing region.
529
529
530
530
let y_plane = & image. y_plane [ 0 ..image. width ] ;
531
- let chroma_size = image. width . div_ceil ( 2 ) ;
531
+ let chroma_size = ( image. width + 1 ) / 2 ;
532
532
let u_plane = & image. u_plane [ 0 ..chroma_size] ;
533
533
let v_plane = & image. v_plane [ 0 ..chroma_size] ;
534
534
let rgba = & mut rgba[ 0 ..image. width * CHANNELS ] ;
Original file line number Diff line number Diff line change @@ -692,8 +692,8 @@ where
692
692
693
693
let token = reader
694
694
. bytes ( )
695
- . skip_while ( |v| v. as_ref ( ) . ok ( ) . map_or ( false , is_separator) )
696
- . take_while ( |v| v. as_ref ( ) . ok ( ) . map_or ( false , |c| !is_separator ( c) ) )
695
+ . skip_while ( |v| v. as_ref ( ) . ok ( ) . is_some_and ( is_separator) )
696
+ . take_while ( |v| v. as_ref ( ) . ok ( ) . is_some_and ( |c| !is_separator ( c) ) )
697
697
. collect :: < Result < Vec < u8 > , _ > > ( ) ?;
698
698
699
699
if !token. is_ascii ( ) {
Original file line number Diff line number Diff line change @@ -441,6 +441,7 @@ impl<T: Primitive> FromPrimitive<T> for T {
441
441
// 1.0 (white) was picked as firefox and chrome choose to map NaN to that.
442
442
#[ inline]
443
443
fn normalize_float ( float : f32 , max : f32 ) -> f32 {
444
+ #[ allow( clippy:: neg_cmp_op_on_partial_ord) ]
444
445
let clamped = if !( float < 1.0 ) { 1.0 } else { float. max ( 0.0 ) } ;
445
446
( clamped * max) . round ( )
446
447
}
Original file line number Diff line number Diff line change @@ -282,7 +282,7 @@ impl SampleLayout {
282
282
/// Check if a buffer of length `len` is large enough.
283
283
#[ must_use]
284
284
pub fn fits ( & self , len : usize ) -> bool {
285
- self . min_length ( ) . map_or ( false , |min| len >= min)
285
+ self . min_length ( ) . is_some_and ( |min| len >= min)
286
286
}
287
287
288
288
/// The extents of this array, in order of increasing strides.
@@ -747,10 +747,7 @@ impl<Buffer> FlatSamples<Buffer> {
747
747
where
748
748
Buffer : AsRef < [ T ] > ,
749
749
{
750
- let min_length = match self . min_length ( ) {
751
- None => return None ,
752
- Some ( index) => index,
753
- } ;
750
+ let min_length = self . min_length ( ) ?;
754
751
755
752
let slice = self . samples . as_ref ( ) ;
756
753
if slice. len ( ) < min_length {
@@ -765,10 +762,7 @@ impl<Buffer> FlatSamples<Buffer> {
765
762
where
766
763
Buffer : AsMut < [ T ] > ,
767
764
{
768
- let min_length = match self . min_length ( ) {
769
- None => return None ,
770
- Some ( index) => index,
771
- } ;
765
+ let min_length = self . min_length ( ) ?;
772
766
773
767
let slice = self . samples . as_mut ( ) ;
774
768
if slice. len ( ) < min_length {
Original file line number Diff line number Diff line change @@ -870,6 +870,7 @@ where
870
870
let max = S :: DEFAULT_MAX_VALUE ;
871
871
let max: f32 = NumCast :: from ( max) . unwrap ( ) ;
872
872
873
+ #[ allow( clippy:: redundant_guards) ]
873
874
let sum = match kernel. iter ( ) . fold ( 0.0 , |s, & item| s + item) {
874
875
x if x == 0.0 => 1.0 ,
875
876
sum => sum,
You can’t perform that action at this time.
0 commit comments