{"id":13412236,"url":"https://github.com/rust-lang/rustlings","last_synced_at":"2025-05-12T14:56:10.886Z","repository":{"id":37334014,"uuid":"42489829","full_name":"rust-lang/rustlings","owner":"rust-lang","description":":crab: Small exercises to get you used to reading and writing Rust code!","archived":false,"fork":false,"pushed_at":"2025-04-29T19:36:58.000Z","size":4181,"stargazers_count":58032,"open_issues_count":66,"forks_count":10562,"subscribers_count":351,"default_branch":"main","last_synced_at":"2025-05-05T13:56:15.165Z","etag":null,"topics":["beginner-friendly","rust","rustlings"],"latest_commit_sha":null,"homepage":"https://rustlings.cool","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rust-lang.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-09-15T02:25:18.000Z","updated_at":"2025-05-05T13:47:02.000Z","dependencies_parsed_at":"2023-09-28T10:40:14.015Z","dependency_job_id":"bfee1a06-e1a8-414d-8f2b-1d784804f099","html_url":"https://github.com/rust-lang/rustlings","commit_stats":null,"previous_names":[],"tags_count":51,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-lang%2Frustlings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-lang%2Frustlings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-lang%2Frustlings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-lang%2Frustlings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rust-lang","download_url":"https://codeload.github.com/rust-lang/rustlings/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253759856,"owners_count":21959834,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["beginner-friendly","rust","rustlings"],"created_at":"2024-07-30T20:01:22.444Z","updated_at":"2025-05-12T14:56:10.856Z","avatar_url":"https://github.com/rust-lang.png","language":"Rust","readme":"\u003cdiv class=\"oranda-hide\"\u003e\n\n# Rustlings 🦀❤️\n\n\u003c/div\u003e\n\nGreetings and welcome to Rustlings.\nThis project contains small exercises to get you used to reading and writing Rust code.\nThis includes reading and responding to compiler messages!\n\nIt is recommended to do the Rustlings exercises in parallel to reading [the official Rust book](https://doc.rust-lang.org/book/), the most comprehensive resource for learning Rust 📚️\n\n[Rust By Example](https://doc.rust-lang.org/rust-by-example/) is another recommended resource that you might find helpful.\nIt contains code examples and exercises similar to Rustlings, but online.\n\n## Getting Started\n\n### Installing Rust\n\nBefore installing Rustlings, you need to have the **latest version of Rust** installed.\nVisit [www.rust-lang.org/tools/install](https://www.rust-lang.org/tools/install) for further instructions on installing Rust.\nThis will also install _Cargo_, Rust's package/project manager.\n\n\u003e 🐧 If you are on Linux, make sure you have installed `gcc` (for a linker).\n\u003e\n\u003e Deb: `sudo apt install gcc`\n\u003e\n\u003e Dnf: `sudo dnf install gcc`\n\n\u003e 🍎 If you are on MacOS, make sure you have installed Xcode and its developer tools by running `xcode-select --install`.\n\n### Installing Rustlings\n\nThe following command will download and compile Rustlings:\n\n```bash\ncargo install rustlings\n```\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eIf the installation fails…\u003c/strong\u003e (\u003cem\u003eclick to expand\u003c/em\u003e)\u003c/summary\u003e\n\n- Make sure you have the latest Rust version by running `rustup update`\n- Try adding the `--locked` flag: `cargo install rustlings --locked`\n- Otherwise, please [report the issue](https://github.com/rust-lang/rustlings/issues/new)\n\n\u003c/details\u003e\n\n### Initialization\n\nAfter installing Rustlings, run the following command to initialize the `rustlings/` directory:\n\n```bash\nrustlings init\n```\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eIf the command \u003ccode\u003erustlings\u003c/code\u003e can't be found…\u003c/strong\u003e (\u003cem\u003eclick to expand\u003c/em\u003e)\u003c/summary\u003e\n\nYou are probably using Linux and installed Rust using your package manager.\n\nCargo installs binaries to the directory `~/.cargo/bin`.\nSadly, package managers often don't add `~/.cargo/bin` to your `PATH` environment variable.\n\nThe solution is to …\n\n- either add `~/.cargo/bin` manually to `PATH`\n- or to uninstall Rust from the package manager and install it using the official way with `rustup`: https://www.rust-lang.org/tools/install\n\n\u003c/details\u003e\n\nNow, go into the newly initialized directory and launch Rustlings for further instructions on getting started with the exercises:\n\n```bash\ncd rustlings/\nrustlings\n```\n\n## Working environment\n\n### Editor\n\nOur general recommendation is [VS Code](https://code.visualstudio.com/) with the [rust-analyzer plugin](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer).\nBut any editor that supports [rust-analyzer](https://rust-analyzer.github.io/) should be enough for working on the exercises.\n\n### Terminal\n\nWhile working with Rustlings, please use a modern terminal for the best user experience.\nThe default terminal on Linux and Mac should be sufficient.\nOn Windows, we recommend the [Windows Terminal](https://aka.ms/terminal).\n\n## Doing exercises\n\nThe exercises are sorted by topic and can be found in the subdirectory `exercises/\u003ctopic\u003e`.\nFor every topic, there is an additional `README.md` file with some resources to get you started on the topic.\nWe highly recommend that you have a look at them before you start 📚️\n\nMost exercises contain an error that keeps them from compiling, and it's up to you to fix it!\nSome exercises contain tests that need to pass for the exercise to be done ✅\n\nSearch for `TODO` and `todo!()` to find out what you need to change.\nAsk for hints by entering `h` in the _watch mode_ 💡\n\n### Watch Mode\n\nAfter the [initialization](#initialization), Rustlings can be launched by simply running the command `rustlings`.\n\nThis will start the _watch mode_ which walks you through the exercises in a predefined order (what we think is best for newcomers).\nIt will rerun the current exercise automatically every time you change the exercise's file in the `exercises/` directory.\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eIf detecting file changes in the \u003ccode\u003eexercises/\u003c/code\u003e directory fails…\u003c/strong\u003e (\u003cem\u003eclick to expand\u003c/em\u003e)\u003c/summary\u003e\n\n\u003e You can add the **`--manual-run`** flag (`rustlings --manual-run`) to manually rerun the current exercise by entering `r` in the watch mode.\n\u003e\n\u003e Please [report the issue](https://github.com/rust-lang/rustlings/issues/new) with some information about your operating system and whether you run Rustlings in a container or virtual machine (e.g. WSL).\n\n\u003c/details\u003e\n\n### Exercise List\n\nIn the [watch mode](#watch-mode) (after launching `rustlings`), you can enter `l` to open the interactive exercise list.\n\nThe list allows you to…\n\n- See the status of all exercises (done or pending)\n- `c`: Continue at another exercise (temporarily skip some exercises or go back to a previous one)\n- `r`: Reset status and file of the selected exercise (you need to _reload/reopen_ its file in your editor afterwards)\n\nSee the footer of the list for all possible keys.\n\n## Questions?\n\nIf you need any help while doing the exercises and the builtin-hints aren't helpful, feel free to ask in the [_Q\u0026A_ category of the discussions](https://github.com/rust-lang/rustlings/discussions/categories/q-a?discussions_q=) if your question wasn't asked yet 💡\n\n## Third-Party Exercises\n\nThird-party exercises are a set of exercises maintained by the community.\nYou can use the same `rustlings` program that you installed with `cargo install rustlings` to run them:\n\n- 🇯🇵 [Japanese Rustlings](https://github.com/sotanengel/rustlings-jp)：A Japanese translation of the Rustlings exercises.\n- 🇨🇳 [Simplified Chinese Rustlings](https://github.com/SandmeyerX/rustlings-zh-cn): A simplified Chinese translation of the Rustlings exercises.\n\nDo you want to create your own set of Rustlings exercises to focus on some specific topic?\nOr do you want to translate the original Rustlings exercises?\nThen follow the the guide about [third-party exercises](https://github.com/rust-lang/rustlings/blob/main/THIRD_PARTY_EXERCISES.md)!\n\n## Continuing On\n\nOnce you've completed Rustlings, put your new knowledge to good use!\nContinue practicing your Rust skills by building your own projects, contributing to Rustlings, or finding other open-source projects to contribute to.\n\n## Uninstalling Rustlings\n\nIf you want to remove Rustlings from your system, run the following command:\n\n```bash\ncargo uninstall rustlings\n```\n\n## Contributing\n\nSee [CONTRIBUTING.md](https://github.com/rust-lang/rustlings/blob/main/CONTRIBUTING.md) 🔗\n\nThanks to [all the wonderful contributors](https://github.com/rust-lang/rustlings/graphs/contributors) ✨\n","funding_links":[],"categories":["Rust","生活的智慧","Uncategorized","Rust Tools","rust","Resources","资源 Resources","Credits","Rust Tools and Frameworks","network programming","Programming Languages","HarmonyOS","Rust 程序设计","Summary","Rust Tools, Libraries, and Frameworks","beginner-friendly","书籍/教程/文档","Tools","Miscellaneous","资源","Languages"],"sub_categories":["Uncategorized","In-memory data grids","Web programming","网络编程 Web programming","Rust","Interfaces","Windows Manager","网络服务_其他","Graph Theory","E-Books","VS Code Extensions for Developer Productivity","Mesh networks","JavaScript Libraries for Machine Learning","网页编程","web编程 Web programming","collection"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-lang%2Frustlings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frust-lang%2Frustlings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-lang%2Frustlings/lists"}