From a51d6f1309b986c270d781b08f6949f29806b18a Mon Sep 17 00:00:00 2001 From: mo8it Date: Sat, 17 May 2025 21:25:19 +0200 Subject: [PATCH] third-party/custom -> community --- CHANGELOG.md | 10 ++++----- src/app_state.rs | 4 ++-- src/dev.rs | 2 +- src/dev/new.rs | 8 +++---- src/info_file.rs | 4 ++-- src/main.rs | 2 +- website/config.toml | 4 ++-- .../index.md | 21 +++++++++---------- website/content/usage/index.md | 2 +- 9 files changed, 28 insertions(+), 29 deletions(-) rename website/content/{custom-exercises => community-exercises}/index.md (85%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6781ba89..c1dbb42b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ - New option `x` in the prompt to reset the file of the current exercise πŸ”„ - Allow `dead_code` for all exercises and solutions ⚰️ (thanks to [@huss4in](https://github.com/huss4in)) - Pause input while running an exercise to avoid unexpected prompt interactions ⏸️ -- Limit the maximum number of exercises to 999. Any third-party exercises willing to reach that limit? πŸ” +- Limit the maximum number of exercises to 999. Any community exercises willing to reach that limit? πŸ” ### Changed @@ -93,7 +93,7 @@ #### Added -- `dev check`: Check that all exercises (including third-party ones) include at least one `TODO` comment. +- `dev check`: Check that all exercises (including community ones) include at least one `TODO` comment. - `dev check`: Check that all exercises actually fail to run (not already solved). #### Changed @@ -168,13 +168,13 @@ This should avoid issues related to the language server or to running exercises, Clippy lints are now shown on all exercises, not only the Clippy exercises πŸ“Ž Make Clippy your friend from early on πŸ₯° -### Third-party exercises +### Community Exercises -Rustlings now supports third-party exercises! +Rustlings now supports community exercises! Do you want to create your own set of Rustlings exercises to focus on some specific topic? Or do you want to translate the original Rustlings exercises? -Then follow the link to the guide about [third-party exercises](THIRD_PARTY_EXERCISES.md)! +Then follow the link to the guide about [community exercises](https://rustlings.rust-lang.org/community-exercises)! ## 5.6.1 (2023-09-18) diff --git a/src/app_state.rs b/src/app_state.rs index d1c45d49..f3f34813 100644 --- a/src/app_state.rs +++ b/src/app_state.rs @@ -315,7 +315,7 @@ impl AppState { } // Official exercises: Dump the original file from the binary. - // Third-party exercises: Reset the exercise file with `git stash`. + // Community exercises: Reset the exercise file with `git stash`. fn reset(&self, exercise_ind: usize, path: &str) -> Result<()> { if self.official_exercises { return EMBEDDED_FILES @@ -385,7 +385,7 @@ impl AppState { } /// Official exercises: Dump the solution file from the binary and return its path. - /// Third-party exercises: Check if a solution file exists and return its path in that case. + /// Community exercises: Check if a solution file exists and return its path in that case. pub fn current_solution_path(&self) -> Result> { if cfg!(debug_assertions) { return Ok(None); diff --git a/src/dev.rs b/src/dev.rs index 354d77c4..41fddbeb 100644 --- a/src/dev.rs +++ b/src/dev.rs @@ -8,7 +8,7 @@ mod update; #[derive(Subcommand)] pub enum DevCommands { - /// Create a new project for third-party Rustlings exercises + /// Create a new project for community exercises New { /// The path to create the project in path: PathBuf, diff --git a/src/dev/new.rs b/src/dev/new.rs index ba3517f5..883b6fa7 100644 --- a/src/dev/new.rs +++ b/src/dev/new.rs @@ -86,10 +86,10 @@ target/ "; const INFO_FILE_BEFORE_FORMAT_VERSION: &str = - "# The format version is an indicator of the compatibility of third-party exercises with the + "# The format version is an indicator of the compatibility of community exercises with the # Rustlings program. # The format version is not the same as the version of the Rustlings program. -# In case Rustlings makes an unavoidable breaking change to the expected format of third-party +# In case Rustlings makes an unavoidable breaking change to the expected format of community # exercises, you would need to raise this version and adapt to the new format. # Otherwise, the newest version of the Rustlings program won't be able to run these exercises. format_version = "; @@ -97,7 +97,7 @@ format_version = "; const INFO_FILE_AFTER_FORMAT_VERSION: &str = r#" # Optional multi-line message to be shown to users when just starting with the exercises. -welcome_message = """Welcome to these third-party Rustlings exercises.""" +welcome_message = """Welcome to these community Rustlings exercises.""" # Optional multi-line message to be shown to users after finishing all exercises. final_message = """We hope that you found the exercises helpful :D""" @@ -141,7 +141,7 @@ publish = false const README: &str = "# Rustlings πŸ¦€ -Welcome to these third-party Rustlings exercises πŸ˜ƒ +Welcome to these community Rustlings exercises πŸ˜ƒ First, [install Rustlings using the official instructions](https://github.com/rust-lang/rustlings) βœ… diff --git a/src/info_file.rs b/src/info_file.rs index ec61f8ad..634bece9 100644 --- a/src/info_file.rs +++ b/src/info_file.rs @@ -79,7 +79,7 @@ impl RunnableExercise for ExerciseInfo { /// The deserialized `info.toml` file. #[derive(Deserialize)] pub struct InfoFile { - /// For possible breaking changes in the future for third-party exercises. + /// For possible breaking changes in the future for community exercises. pub format_version: u8, /// Shown to users when starting with the exercises. pub welcome_message: Option, @@ -91,7 +91,7 @@ pub struct InfoFile { impl InfoFile { /// Official exercises: Parse the embedded `info.toml` file. - /// Third-party exercises: Parse the `info.toml` file in the current directory. + /// Community exercises: Parse the `info.toml` file in the current directory. pub fn parse() -> Result { // Read a local `info.toml` if it exists. let slf = match fs::read_to_string("info.toml") { diff --git a/src/main.rs b/src/main.rs index 6688e3e6..bce2593d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -58,7 +58,7 @@ enum Subcommands { /// The name of the exercise name: Option, }, - /// Commands for developing (third-party) Rustlings exercises + /// Commands for developing (community) Rustlings exercises #[command(subcommand)] Dev(DevCommands), } diff --git a/website/config.toml b/website/config.toml index 8ecb09b9..796f13a4 100644 --- a/website/config.toml +++ b/website/config.toml @@ -24,8 +24,8 @@ url = "/setup" name = "Usage" url = "/usage" [[extra.menu_items]] -name = "Custom Exercises" -url = "/custom-exercises" +name = "Community Exercises" +url = "/community-exercises" [[extra.menu_items]] name = "Q&A" url = "https://github.com/rust-lang/rustlings/discussions/categories/q-a?discussions_q=" diff --git a/website/content/custom-exercises/index.md b/website/content/community-exercises/index.md similarity index 85% rename from website/content/custom-exercises/index.md rename to website/content/community-exercises/index.md index e8bef769..1c8cd577 100644 --- a/website/content/custom-exercises/index.md +++ b/website/content/community-exercises/index.md @@ -1,24 +1,23 @@ +++ -title = "Custom Exercises" +title = "Community Exercises" +++ -Custom exercises are a set of exercises maintained by the community. -You can use the same `rustlings` program that you installed with `cargo install rustlings` to run them: - -- πŸ‡―πŸ‡΅ [Japanese Rustlings](https://github.com/sotanengel/rustlings-jp):A Japanese translation of the Rustlings exercises. -- πŸ‡¨πŸ‡³ [Simplified Chinese Rustlings](https://github.com/SandmeyerX/rustlings-zh-cn): A simplified Chinese translation of the Rustlings exercises. - Do you want to create your own set of Rustlings exercises to focus on some specific topic? Or do you want to translate the original Rustlings exercises? - +## List of Community Exercises -The support of Rustlings for custom exercises allows you to create your own set of Rustlings exercises to focus on some specific topic. -You could also offer a translation of the original Rustlings exercises as custom exercises. +- πŸ‡―πŸ‡΅ [Japanese Rustlings](https://github.com/sotanengel/rustlings-jp):A Japanese translation of the Rustlings exercises. +- πŸ‡¨πŸ‡³ [Simplified Chinese Rustlings](https://github.com/SandmeyerX/rustlings-zh-cn): A simplified Chinese translation of the Rustlings exercises. + +You can use the same `rustlings` program that you installed with `cargo install rustlings` to run them + +The support of Rustlings for community exercises allows you to create your own set of Rustlings exercises to focus on some specific topic. +You could also offer a translation of the original Rustlings exercises as community exercises. ## Getting started -To create custom exercises, install Rustlings and run `rustlings dev new PROJECT_NAME`. +To create community exercises, install Rustlings and run `rustlings dev new PROJECT_NAME`. This command will, similar to `cargo new PROJECT_NAME`, create a template directory called `PROJECT_NAME` with all what you need to get started. Read the comments in the generated `info.toml` file to understand its format. diff --git a/website/content/usage/index.md b/website/content/usage/index.md index 7bf02f57..88dabf4a 100644 --- a/website/content/usage/index.md +++ b/website/content/usage/index.md @@ -52,4 +52,4 @@ If you need any help while doing the exercises and the builtin hints aren't help Once you've completed Rustlings, put your new knowledge to good use! Continue practicing your Rust skills by building your own projects, contributing to Rustlings, or finding other open-source projects to contribute to. -> If you want to create your own custom Rustlings exercises, visit the [**custom exercises**](@/custom-exercises/index.md) page πŸ—οΈ +> If you want to create your own Rustlings exercises, visit the [**community exercises**](@/community-exercises/index.md) page πŸ—οΈ