Finish exercises refactor: rename, restructure, and fix all examples#1
Open
mre wants to merge 1 commit into
Open
Finish exercises refactor: rename, restructure, and fix all examples#1mre wants to merge 1 commit into
mre wants to merge 1 commit into
Conversation
Complete the in-progress reshuffle of the exercise track to the 19-exercise progression documented in the README (00-18). Renames / new files - Renumber and rename exercises so file names match the README progression (e.g. 01_integer_handling -> 02_numbers_and_math, 11_password_validator -> 12_password_validator, 12_question_mark_operator -> 13_question_mark_operator, 15_rust_fundamentals_quiz -> 16_quiz, etc.). - New foundation exercises: 01_basic_types, 03_strings_and_text, 04_collections_basics, 08_ownership_and_borrowing, 10_enums_and_matching. Make every example compile cleanly - 00_hello_rust: add #[cfg(test)] + use super::*; fix four lines accidentally written as ///! (outer doc comment) instead of //! (inner module docs). - 01-04 (foundation): add missing #[cfg(test)] on mod tests and gate bonus modules with #[cfg(all(test, feature = "bonus"))] so they participate in the test build instead of being silently skipped. - 05_tuples_and_structs: mark bonus functions pub and reach them from bonus_tests via super::super::bonus so the bonus build compiles. - 06_option_and_some_none: add explicit lifetime to find_user_by_id. - 08_ownership_and_borrowing: add explicit lifetime to find_longest_word. - 13_question_mark_operator: stop comparing Result<_, io::Error> / Result<_, Box<dyn Error>> with assert_eq!; unwrap and compare values. - 15_modules: rewrite so the modules expose a real pub API and the wrapper functions are todo!() placeholders the student fills in. Cargo / server cleanup - Cargo.toml: fix stale [package.metadata.exercises.12_question_mark_operator] key (now 13_question_mark_operator). - src/bin/server.rs: silence two dead_code warnings on DbParticipant / DbSubmission with #[allow(dead_code)] (sqlx::FromRow needs the fields). Repo hygiene - .gitignore: ignore local TODO/ scratch directory so planning notes stay out of the tree. Verification - cargo test --example XX --no-run is green for all 19 exercises. - cargo test --example XX --features bonus --no-run is green for all 19. - cargo build --bin server is warning-free.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Completes the in-progress reshuffle of the exercise track to the 19-exercise progression documented in the README (00–18).
Renames / new files
(e.g.
01_integer_handling→02_numbers_and_math,11_password_validator→12_password_validator,12_question_mark_operator→13_question_mark_operator,15_rust_fundamentals_quiz→16_quiz, etc.).01_basic_types,03_strings_and_text,04_collections_basics,08_ownership_and_borrowing,10_enums_and_matching.Make every example compile cleanly
00_hello_rust: add#[cfg(test)]+use super::*; fix four lines accidentallywritten as
///!(outer doc comment) instead of//!(inner module docs).01–04(foundation): add missing#[cfg(test)]onmod testsand gate bonusmodules with
#[cfg(all(test, feature = "bonus"))]so they participate inthe test build instead of being silently skipped.
05_tuples_and_structs: mark bonus functionspuband reach them frombonus_testsviasuper::super::bonusso the bonus build compiles.06_option_and_some_none: add explicit lifetime tofind_user_by_id.08_ownership_and_borrowing: add explicit lifetime tofind_longest_word.13_question_mark_operator: stop comparingResult<_, io::Error>/Result<_, Box<dyn Error>>withassert_eq!;unwrap()and compare values.15_modules: rewrite so the modules expose a realpubAPI and the wrapperfunctions are
todo!()placeholders the student fills in.Cargo / server cleanup
Cargo.toml: fix stale[package.metadata.exercises.12_question_mark_operator]key (now
13_question_mark_operator).src/bin/server.rs: silence twodead_codewarnings onDbParticipant/DbSubmissionwith#[allow(dead_code)](sqlx::FromRowneeds the fields).Repo hygiene
.gitignore: ignore localTODO/scratch directory so planning notes stayout of the tree.
Verification
cargo test --example XX --no-runis green for all 19 exercises.cargo test --example XX --features bonus --no-runis green for all 19.cargo build --bin serveris warning-free.