@@ -128,13 +128,13 @@ impl<'a, T> OffsetReader<'a, T> {
128128 }
129129}
130130
131- impl < ' a , T > Offset for OffsetReader < ' a , T > {
131+ impl < T > Offset for OffsetReader < ' _ , T > {
132132 fn offset ( & self ) -> u64 {
133133 self . offset
134134 }
135135}
136136
137- impl < ' a , T : Read > Read for OffsetReader < ' a , T > {
137+ impl < T : Read > Read for OffsetReader < ' _ , T > {
138138 fn read ( & mut self , buf : & mut [ u8 ] ) -> std:: io:: Result < usize > {
139139 let bytes_read = self . reader . read ( buf) ?;
140140 trace ! ( "Read {} bytes at offset {}" , bytes_read, self . offset) ;
@@ -2138,7 +2138,7 @@ struct BoxIter<'a, T: 'a> {
21382138 src : & ' a mut T ,
21392139}
21402140
2141- impl < ' a , T : Read > BoxIter < ' a , T > {
2141+ impl < T : Read > BoxIter < ' _ , T > {
21422142 fn new ( src : & mut T ) -> BoxIter < T > {
21432143 BoxIter { src }
21442144 }
@@ -2156,19 +2156,19 @@ impl<'a, T: Read> BoxIter<'a, T> {
21562156 }
21572157}
21582158
2159- impl < ' a , T : Read > Read for BMFFBox < ' a , T > {
2159+ impl < T : Read > Read for BMFFBox < ' _ , T > {
21602160 fn read ( & mut self , buf : & mut [ u8 ] ) -> std:: io:: Result < usize > {
21612161 self . content . read ( buf)
21622162 }
21632163}
21642164
2165- impl < ' a , T : Read > TryRead for BMFFBox < ' a , T > {
2165+ impl < T : Read > TryRead for BMFFBox < ' _ , T > {
21662166 fn try_read_to_end ( & mut self , buf : & mut TryVec < u8 > ) -> std:: io:: Result < usize > {
21672167 fallible_collections:: try_read_up_to ( self , self . bytes_left ( ) , buf)
21682168 }
21692169}
21702170
2171- impl < ' a , T : Offset > Offset for BMFFBox < ' a , T > {
2171+ impl < T : Offset > Offset for BMFFBox < ' _ , T > {
21722172 fn offset ( & self ) -> u64 {
21732173 self . content . get_ref ( ) . offset ( )
21742174 }
@@ -2183,12 +2183,12 @@ impl<'a, T: Read> BMFFBox<'a, T> {
21832183 & self . head
21842184 }
21852185
2186- fn box_iter < ' b > ( & ' b mut self ) -> BoxIter < BMFFBox < ' a , T > > {
2186+ fn box_iter ( & mut self ) -> BoxIter < BMFFBox < ' a , T > > {
21872187 BoxIter :: new ( self )
21882188 }
21892189}
21902190
2191- impl < ' a , T > Drop for BMFFBox < ' a , T > {
2191+ impl < T > Drop for BMFFBox < ' _ , T > {
21922192 fn drop ( & mut self ) {
21932193 if self . content . limit ( ) > 0 {
21942194 let name: FourCC = From :: from ( self . head . name ) ;
@@ -2206,10 +2206,7 @@ impl<'a, T> Drop for BMFFBox<'a, T> {
22062206///
22072207/// See ISOBMFF (ISO 14496-12:2020) § 4.2
22082208fn read_box_header < T : ReadBytesExt > ( src : & mut T ) -> Result < BoxHeader > {
2209- let size32 = match be_u32 ( src) {
2210- Ok ( v) => v,
2211- Err ( error) => return Err ( error) ,
2212- } ;
2209+ let size32 = be_u32 ( src) ?;
22132210 let name = BoxType :: from ( be_u32 ( src) ?) ;
22142211 let size = match size32 {
22152212 // valid only for top-level box and indicates it's the last box in the file. usually mdat.
@@ -2484,7 +2481,7 @@ pub fn read_avif<T: Read>(f: &mut T, strictness: ParseStrictness) -> Result<Avif
24842481 return Status :: MultipleAlpha . into ( ) ;
24852482 }
24862483
2487- let premultiplied_alpha = alpha_item_id. map_or ( false , |alpha_item_id| {
2484+ let premultiplied_alpha = alpha_item_id. is_some_and ( |alpha_item_id| {
24882485 item_references. iter ( ) . any ( |iref| {
24892486 iref. from_item_id == primary_item_id
24902487 && iref. to_item_id == alpha_item_id
@@ -2623,7 +2620,7 @@ pub fn read_avif<T: Read>(f: &mut T, strictness: ParseStrictness) -> Result<Avif
26232620
26242621 // Returns true iff `id` is `Some` and there is no corresponding property for it
26252622 let missing_property_for = |id : Option < ItemId > , property : BoxType | -> bool {
2626- id. map_or ( false , |id| {
2623+ id. is_some_and ( |id| {
26272624 item_properties
26282625 . get ( id, property)
26292626 . map_or ( true , |opt| opt. is_none ( ) )
0 commit comments