@@ -128,13 +128,13 @@ impl<'a, T> OffsetReader<'a, T> {
128
128
}
129
129
}
130
130
131
- impl < ' a , T > Offset for OffsetReader < ' a , T > {
131
+ impl < T > Offset for OffsetReader < ' _ , T > {
132
132
fn offset ( & self ) -> u64 {
133
133
self . offset
134
134
}
135
135
}
136
136
137
- impl < ' a , T : Read > Read for OffsetReader < ' a , T > {
137
+ impl < T : Read > Read for OffsetReader < ' _ , T > {
138
138
fn read ( & mut self , buf : & mut [ u8 ] ) -> std:: io:: Result < usize > {
139
139
let bytes_read = self . reader . read ( buf) ?;
140
140
trace ! ( "Read {} bytes at offset {}" , bytes_read, self . offset) ;
@@ -2138,7 +2138,7 @@ struct BoxIter<'a, T: 'a> {
2138
2138
src : & ' a mut T ,
2139
2139
}
2140
2140
2141
- impl < ' a , T : Read > BoxIter < ' a , T > {
2141
+ impl < T : Read > BoxIter < ' _ , T > {
2142
2142
fn new ( src : & mut T ) -> BoxIter < T > {
2143
2143
BoxIter { src }
2144
2144
}
@@ -2156,19 +2156,19 @@ impl<'a, T: Read> BoxIter<'a, T> {
2156
2156
}
2157
2157
}
2158
2158
2159
- impl < ' a , T : Read > Read for BMFFBox < ' a , T > {
2159
+ impl < T : Read > Read for BMFFBox < ' _ , T > {
2160
2160
fn read ( & mut self , buf : & mut [ u8 ] ) -> std:: io:: Result < usize > {
2161
2161
self . content . read ( buf)
2162
2162
}
2163
2163
}
2164
2164
2165
- impl < ' a , T : Read > TryRead for BMFFBox < ' a , T > {
2165
+ impl < T : Read > TryRead for BMFFBox < ' _ , T > {
2166
2166
fn try_read_to_end ( & mut self , buf : & mut TryVec < u8 > ) -> std:: io:: Result < usize > {
2167
2167
fallible_collections:: try_read_up_to ( self , self . bytes_left ( ) , buf)
2168
2168
}
2169
2169
}
2170
2170
2171
- impl < ' a , T : Offset > Offset for BMFFBox < ' a , T > {
2171
+ impl < T : Offset > Offset for BMFFBox < ' _ , T > {
2172
2172
fn offset ( & self ) -> u64 {
2173
2173
self . content . get_ref ( ) . offset ( )
2174
2174
}
@@ -2183,12 +2183,12 @@ impl<'a, T: Read> BMFFBox<'a, T> {
2183
2183
& self . head
2184
2184
}
2185
2185
2186
- fn box_iter < ' b > ( & ' b mut self ) -> BoxIter < BMFFBox < ' a , T > > {
2186
+ fn box_iter ( & mut self ) -> BoxIter < BMFFBox < ' a , T > > {
2187
2187
BoxIter :: new ( self )
2188
2188
}
2189
2189
}
2190
2190
2191
- impl < ' a , T > Drop for BMFFBox < ' a , T > {
2191
+ impl < T > Drop for BMFFBox < ' _ , T > {
2192
2192
fn drop ( & mut self ) {
2193
2193
if self . content . limit ( ) > 0 {
2194
2194
let name: FourCC = From :: from ( self . head . name ) ;
@@ -2206,10 +2206,7 @@ impl<'a, T> Drop for BMFFBox<'a, T> {
2206
2206
///
2207
2207
/// See ISOBMFF (ISO 14496-12:2020) § 4.2
2208
2208
fn 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) ?;
2213
2210
let name = BoxType :: from ( be_u32 ( src) ?) ;
2214
2211
let size = match size32 {
2215
2212
// 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
2484
2481
return Status :: MultipleAlpha . into ( ) ;
2485
2482
}
2486
2483
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| {
2488
2485
item_references. iter ( ) . any ( |iref| {
2489
2486
iref. from_item_id == primary_item_id
2490
2487
&& iref. to_item_id == alpha_item_id
@@ -2623,7 +2620,7 @@ pub fn read_avif<T: Read>(f: &mut T, strictness: ParseStrictness) -> Result<Avif
2623
2620
2624
2621
// Returns true iff `id` is `Some` and there is no corresponding property for it
2625
2622
let missing_property_for = |id : Option < ItemId > , property : BoxType | -> bool {
2626
- id. map_or ( false , |id| {
2623
+ id. is_some_and ( |id| {
2627
2624
item_properties
2628
2625
. get ( id, property)
2629
2626
. map_or ( true , |opt| opt. is_none ( ) )
0 commit comments