File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ use crate::{
1717 CURRENT_FORMAT_VERSION ,
1818} ;
1919
20+ const MAX_N_EXERCISES : usize = 999 ;
2021const MAX_EXERCISE_NAME_LEN : usize = 32 ;
2122
2223// Find a char that isn't allowed in the exercise's `name` or `dir`.
@@ -347,6 +348,10 @@ fn check_solutions(
347348pub fn check ( require_solutions : bool ) -> Result < ( ) > {
348349 let info_file = InfoFile :: parse ( ) ?;
349350
351+ if info_file. exercises . len ( ) > MAX_N_EXERCISES {
352+ bail ! ( "The maximum number of exercises is {MAX_N_EXERCISES}" ) ;
353+ }
354+
350355 if cfg ! ( debug_assertions) {
351356 // A hack to make `cargo run -- dev check` work when developing Rustlings.
352357 check_cargo_toml ( & info_file. exercises , "dev/Cargo.toml" , b"../" ) ?;
Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ pub fn progress_bar<'a>(
166166 total : u16 ,
167167 term_width : u16 ,
168168) -> io:: Result < ( ) > {
169- debug_assert ! ( total < 1000 ) ;
169+ debug_assert ! ( total <= 999 ) ;
170170 debug_assert ! ( progress <= total) ;
171171
172172 const PREFIX : & [ u8 ] = b"Progress: [" ;
You can’t perform that action at this time.
0 commit comments