@@ -98,7 +98,7 @@ impl CourseRefresher {
98
98
99
99
let course_options = get_course_options ( & new_clone_path, & course_name) ?;
100
100
self . progress_reporter
101
- . finish_step ( "Updated course options" . to_string ( ) , None ) ?;
101
+ . finish_step ( "Fetched course options" . to_string ( ) , None ) ?;
102
102
103
103
let new_solution_path = new_cache_path. join ( "solution" ) ;
104
104
let new_stub_path = new_cache_path. join ( "stub" ) ;
@@ -281,21 +281,7 @@ fn get_course_options(course_clone_path: &Path, course_name: &str) -> Result<Map
281
281
let options_file = course_clone_path. join ( "course_options.yml" ) ;
282
282
if options_file. exists ( ) {
283
283
let file = file_util:: open_file ( options_file) ?;
284
- let mut course_options: Mapping = serde_yaml:: from_reader ( file) ?;
285
- // try to remove the "courses" map
286
- if let Some ( serde_yaml:: Value :: Mapping ( mut courses) ) =
287
- course_options. remove ( & serde_yaml:: Value :: String ( "courses" . to_string ( ) ) )
288
- {
289
- // try to remove the map corresponding to the current course from the "courses" map
290
- if let Some ( serde_yaml:: Value :: Mapping ( mapping) ) =
291
- courses. remove ( & serde_yaml:: Value :: String ( course_name. to_string ( ) ) )
292
- {
293
- // if found, merge the inner course map with the base map
294
- for ( key, value) in mapping {
295
- course_options. insert ( key, value) ;
296
- }
297
- }
298
- }
284
+ let course_options: Mapping = serde_yaml:: from_reader ( file) ?;
299
285
Ok ( course_options)
300
286
} else {
301
287
Ok ( Mapping :: new ( ) )
@@ -518,7 +504,7 @@ mod test {
518
504
}
519
505
520
506
#[ test]
521
- fn updates_course_options ( ) {
507
+ fn gets_course_options ( ) {
522
508
init ( ) ;
523
509
524
510
let temp = tempfile:: tempdir ( ) . unwrap ( ) ;
@@ -532,31 +518,6 @@ mod test {
532
518
. unwrap( ) )
533
519
}
534
520
535
- #[ test]
536
- fn updates_course_options_merged ( ) {
537
- init ( ) ;
538
-
539
- let temp = tempfile:: tempdir ( ) . unwrap ( ) ;
540
- file_to (
541
- & temp,
542
- "course_options.yml" ,
543
- r#"
544
- courses:
545
- course_1:
546
- option: true
547
- course_2:
548
- other_option: true
549
- "# ,
550
- ) ;
551
- let options = get_course_options ( temp. path ( ) , "course_1" ) . unwrap ( ) ;
552
- assert_eq ! ( options. len( ) , 1 ) ;
553
- assert ! ( options
554
- . get( & Value :: String ( "option" . to_string( ) ) )
555
- . unwrap( )
556
- . as_bool( )
557
- . unwrap( ) )
558
- }
559
-
560
521
#[ test]
561
522
fn gets_exercises ( ) {
562
523
init ( ) ;
0 commit comments