@@ -156,7 +156,7 @@ impl Courses {
156
156
fn course_mut ( & mut self , name : impl AsRef < str > ) -> & mut Course {
157
157
let name = name. as_ref ( ) ;
158
158
if let Some ( found_idx) =
159
- self . courses . iter ( ) . position ( |course| & course. name == name)
159
+ self . courses . iter ( ) . position ( |course| course. name == name)
160
160
{
161
161
return & mut self . courses [ found_idx] ;
162
162
}
@@ -177,9 +177,7 @@ impl Courses {
177
177
& self ,
178
178
chapter : & Chapter ,
179
179
) -> Option < ( & Course , & Session , & Segment , & Slide ) > {
180
- let Some ( ref source_path) = chapter. source_path else {
181
- return None ;
182
- } ;
180
+ let source_path = chapter. source_path . as_ref ( ) ?;
183
181
184
182
for course in self {
185
183
for session in course {
@@ -193,7 +191,7 @@ impl Courses {
193
191
}
194
192
}
195
193
196
- return None ;
194
+ None
197
195
}
198
196
}
199
197
@@ -202,7 +200,7 @@ impl<'a> IntoIterator for &'a Courses {
202
200
type IntoIter = std:: slice:: Iter < ' a , Course > ;
203
201
204
202
fn into_iter ( self ) -> Self :: IntoIter {
205
- ( & self . courses ) . into_iter ( )
203
+ self . courses . iter ( )
206
204
}
207
205
}
208
206
@@ -216,7 +214,7 @@ impl Course {
216
214
fn session_mut ( & mut self , name : impl AsRef < str > ) -> & mut Session {
217
215
let name = name. as_ref ( ) ;
218
216
if let Some ( found_idx) =
219
- self . sessions . iter ( ) . position ( |session| & session. name == name)
217
+ self . sessions . iter ( ) . position ( |session| session. name == name)
220
218
{
221
219
return & mut self . sessions [ found_idx] ;
222
220
}
@@ -275,7 +273,7 @@ impl<'a> IntoIterator for &'a Course {
275
273
type IntoIter = std:: slice:: Iter < ' a , Session > ;
276
274
277
275
fn into_iter ( self ) -> Self :: IntoIter {
278
- ( & self . sessions ) . into_iter ( )
276
+ self . sessions . iter ( )
279
277
}
280
278
}
281
279
@@ -348,7 +346,7 @@ impl<'a> IntoIterator for &'a Session {
348
346
type IntoIter = std:: slice:: Iter < ' a , Segment > ;
349
347
350
348
fn into_iter ( self ) -> Self :: IntoIter {
351
- ( & self . segments ) . into_iter ( )
349
+ self . segments . iter ( )
352
350
}
353
351
}
354
352
@@ -401,7 +399,7 @@ impl<'a> IntoIterator for &'a Segment {
401
399
type IntoIter = std:: slice:: Iter < ' a , Slide > ;
402
400
403
401
fn into_iter ( self ) -> Self :: IntoIter {
404
- ( & self . slides ) . into_iter ( )
402
+ self . slides . iter ( )
405
403
}
406
404
}
407
405
@@ -449,7 +447,7 @@ impl Slide {
449
447
pub fn is_sub_chapter ( & self , chapter : & Chapter ) -> bool {
450
448
// The first `source_path` in the slide is the "parent" chapter, so anything
451
449
// else is a sub-chapter.
452
- chapter. source_path . as_ref ( ) != self . source_paths . get ( 0 )
450
+ chapter. source_path . as_ref ( ) != self . source_paths . first ( )
453
451
}
454
452
455
453
/// Return the total duration of this slide.
0 commit comments