Thanks for stopping by. This repo allows you to suggest ideas for exercises and write your own.
-
Create an issue with a short description of your idea.
-
If you want to write the exercise, mention this in the issue.
-
Fork this repo. If this is your first exercise, make sure you install the pre-commit hook:
pre-commit install
(we usecargo fmt|check|clippy
to keep the code clean). -
Create a new directory with the exercise name (use underscores):
cp -r template my_exercise_name
-
Add your exercise code and tests to
src/lib.rs
. -
Copy the
src/lib.rs
file tosrc/lib-template.rs
(cp src/main.rs src/main-template.rs
) and remove the tests (just so we have them once only) and update remove the part of the solution code you don't want users to see (so this version is what users will see when they first open the exercise). -
Update
exercise.md
with the meta data (header), title and description using markdown (keep it concise please). -
Update the
Cargo.toml
file if you need to include any dependencies in order to run the exercise, in that case list them under[dependencies]
wit their exact version (and features if needed). -
Validate the code will compile locally by running the tests in your exercise directory:
cargo test
(you can ignore dead code warnings for now, that's because the function(s) are not called outside of the tests). -
Open a PR with your new exercise, we will review and when all good, merge it in. After merge your exercise will be added to the platform crediting your GitHub user account you listed in
exercise.md
.
Happy coding and let's learn more Rust together! 🦀