File tree Expand file tree Collapse file tree 6 files changed +8
-13
lines changed Expand file tree Collapse file tree 6 files changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -358,8 +358,7 @@ impl LanguagePlugin for CSharpPlugin {
358358 |points| {
359359 points
360360 . into_iter ( )
361- . map ( |p| p. split_whitespace ( ) )
362- . flatten ( )
361+ . flat_map ( |p| p. split_whitespace ( ) )
363362 . collect ( )
364363 } ,
365364 ) ( i)
Original file line number Diff line number Diff line change @@ -276,8 +276,7 @@ pub(crate) trait JavaPlugin: LanguagePlugin {
276276 |points| {
277277 points
278278 . into_iter ( )
279- . map ( |p| p. split_whitespace ( ) )
280- . flatten ( )
279+ . flat_map ( |p| p. split_whitespace ( ) )
281280 . collect ( )
282281 } ,
283282 ) ( i)
Original file line number Diff line number Diff line change @@ -467,8 +467,7 @@ impl LanguagePlugin for Python3Plugin {
467467 |points| {
468468 points
469469 . into_iter ( )
470- . map ( |p| p. split_whitespace ( ) )
471- . flatten ( )
470+ . flat_map ( |p| p. split_whitespace ( ) )
472471 . collect ( )
473472 } ,
474473 ) ( i)
Original file line number Diff line number Diff line change @@ -94,8 +94,7 @@ impl ProjectsConfig {
9494 pub fn get_all_exercises ( & self ) -> impl Iterator < Item = & ProjectsDirExercise > {
9595 self . courses
9696 . iter ( )
97- . map ( |c| & c. 1 . exercises )
98- . flatten ( )
97+ . flat_map ( |c| & c. 1 . exercises )
9998 . map ( |e| e. 1 )
10099 }
101100
Original file line number Diff line number Diff line change @@ -187,7 +187,7 @@ fn initialize_new_cache_clone(
187187 file_util:: copy ( old_clone_path, new_course_root) ?;
188188
189189 let run_git = |args : & [ & str ] | {
190- TmcCommand :: piped ( "git" . to_string ( ) )
190+ TmcCommand :: piped ( "git" )
191191 . with ( |e| e. cwd ( new_clone_path) . args ( args) )
192192 . output_with_timeout_checked ( Duration :: from_secs ( 60 * 2 ) )
193193 } ;
@@ -215,7 +215,7 @@ fn initialize_new_cache_clone(
215215 log:: info!( "could not copy from previous cache, cloning" ) ;
216216
217217 // clone_repository
218- TmcCommand :: piped ( "git" . to_string ( ) )
218+ TmcCommand :: piped ( "git" )
219219 . with ( |e| {
220220 e. args ( & [ "clone" , "-q" , "-b" ] )
221221 . arg ( course_git_branch)
@@ -304,7 +304,7 @@ fn get_exercises(
304304 "processing points and checksum for {}" ,
305305 exercise_dir. display( )
306306 ) ;
307- let name = exercise_dir. to_string_lossy ( ) . replace ( "/" , "-" ) ;
307+ let name = exercise_dir. to_string_lossy ( ) . replace ( '/' , "-" ) ;
308308 let checksum = calculate_checksum ( & course_stub_path. join ( & exercise_dir) ) ?;
309309 let exercise_path = course_clone_path. join ( & exercise_dir) ;
310310 let points = super :: get_available_points ( & exercise_path) ?;
Original file line number Diff line number Diff line change @@ -593,8 +593,7 @@ pub fn update_exercises(
593593 let exercise_ids = projects_config
594594 . courses
595595 . iter_mut ( )
596- . map ( |c| & mut c. 1 . exercises )
597- . flatten ( )
596+ . flat_map ( |c| & mut c. 1 . exercises )
598597 . map ( |e| e. 1 . id )
599598 . collect :: < Vec < _ > > ( ) ;
600599
You can’t perform that action at this time.
0 commit comments