{"id":18716603,"url":"https://github.com/timothyye/rustlings-solution","last_synced_at":"2025-08-12T12:33:34.660Z","repository":{"id":147046925,"uuid":"514539893","full_name":"TimothyYe/rustlings-solution","owner":"TimothyYe","description":null,"archived":false,"fork":false,"pushed_at":"2022-07-16T10:07:20.000Z","size":1496,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-19T12:49:05.144Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/TimothyYe.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":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-16T09:57:05.000Z","updated_at":"2022-07-16T10:10:19.000Z","dependencies_parsed_at":"2023-09-08T09:46:46.690Z","dependency_job_id":null,"html_url":"https://github.com/TimothyYe/rustlings-solution","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TimothyYe/rustlings-solution","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimothyYe%2Frustlings-solution","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimothyYe%2Frustlings-solution/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimothyYe%2Frustlings-solution/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimothyYe%2Frustlings-solution/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TimothyYe","download_url":"https://codeload.github.com/TimothyYe/rustlings-solution/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimothyYe%2Frustlings-solution/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270061206,"owners_count":24520261,"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","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-07T13:13:10.951Z","updated_at":"2025-08-12T12:33:34.636Z","avatar_url":"https://github.com/TimothyYe.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rustlings with solutions 🦀❤️\n\nGreetings and welcome to `rustlings`. This project contains small exercises to get you used to reading and writing Rust code. This includes reading and responding to compiler messages!\n\n_...looking for the old, web-based version of Rustlings? Try [here](https://github.com/rust-lang/rustlings/tree/rustlings-1)_\n\nAlternatively, for a first-time Rust learner, there are several other resources:\n\n- [The Book](https://doc.rust-lang.org/book/index.html) - The most comprehensive resource for learning Rust, but a bit theoretical sometimes. You will be using this along with Rustlings!\n- [Rust By Example](https://doc.rust-lang.org/rust-by-example/index.html) - Learn Rust by solving little exercises! It's almost like `rustlings`, but online\n\n## Getting Started\n\n_Note: If you're on MacOS, make sure you've installed Xcode and its developer tools by typing `xcode-select --install`._\n_Note: If you're on Linux, make sure you've installed gcc. Deb: `sudo apt install gcc`. Yum: `sudo yum -y install gcc`._\n\nYou will need to have Rust installed. You can get it by visiting https://rustup.rs. This'll also install Cargo, Rust's package/project manager.\n\n## MacOS/Linux\n\nJust run:\n\n```bash\ncurl -L https://raw.githubusercontent.com/rust-lang/rustlings/main/install.sh | bash\n# Or if you want it to be installed to a different path:\ncurl -L https://raw.githubusercontent.com/rust-lang/rustlings/main/install.sh | bash -s mypath/\n```\n\nThis will install Rustlings and give you access to the `rustlings` command. Run it to get started!\n\n## Windows\n\nIn PowerShell (Run as Administrator), set `ExecutionPolicy` to `RemoteSigned`:\n\n```ps1\nSet-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser\n```\n\nThen, you can run:\n\n```ps1\nStart-BitsTransfer -Source https://raw.githubusercontent.com/rust-lang/rustlings/main/install.ps1 -Destination $env:TMP/install_rustlings.ps1; Unblock-File $env:TMP/install_rustlings.ps1; Invoke-Expression $env:TMP/install_rustlings.ps1\n```\n\nTo install Rustlings. Same as on MacOS/Linux, you will have access to the `rustlings` command after it.\n\nWhen you get a permission denied message then you have to exclude the directory where you placed the rustlings in your virus-scanner\n\n## Browser:\n\n[Run on Repl.it](https://repl.it/github/rust-lang/rustlings)\n\n[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/rust-lang/rustlings)\n\n## Manually\n\nBasically: Clone the repository at the latest tag, run `cargo install`.\n\n```bash\n# find out the latest version at https://github.com/rust-lang/rustlings/releases/latest (on edit 4.7.1)\ngit clone -b 4.7.1 --depth 1 https://github.com/rust-lang/rustlings\ncd rustlings\ncargo install --force --path .\n```\n\nIf there are installation errors, ensure that your toolchain is up to date. For the latest, run:\n\n```bash\nrustup update\n```\n\nThen, same as above, run `rustlings` to get started.\n\n## Doing exercises\n\nThe exercises are sorted by topic and can be found in the subdirectory `rustlings/exercises/\u003ctopic\u003e`. For every topic there is an additional README file with some resources to get you started on the topic. We really recommend that you have a look at them before you start.\n\nThe task is simple. Most exercises contain an error that keeps them from compiling, and it's up to you to fix it! Some exercises are also run as tests, but rustlings handles them all the same. To run the exercises in the recommended order, execute:\n\n```bash\nrustlings watch\n```\n\nThis will try to verify the completion of every exercise in a predetermined order (what we think is best for newcomers). It will also rerun automatically every time you change a file in the `exercises/` directory. If you want to only run it once, you can use:\n\n```bash\nrustlings verify\n```\n\nThis will do the same as watch, but it'll quit after running.\n\nIn case you want to go by your own order, or want to only verify a single exercise, you can run:\n\n```bash\nrustlings run myExercise1\n```\n\nOr simply use the following command to run the next unsolved exercise in the course:\n\n```bash\nrustlings run next\n```\n\nIn case you get stuck, you can run the following command to get a hint for your\nexercise:\n\n```bash\nrustlings hint myExercise1\n```\n\nYou can also get the hint for the next unsolved exercise with the following command:\n\n```bash\nrustlings hint next\n```\n\nTo check your progress, you can run the following command:\n\n```bash\nrustlings list\n```\n\n## Testing yourself\n\nAfter every couple of sections, there will be a quiz that'll test your knowledge on a bunch of sections at once. These quizzes are found in `exercises/quizN.rs`.\n\n## Enabling `rust-analyzer`\n\n`rust-analyzer` support is provided, but it depends on your editor\nwhether it's enabled by default. (RLS support is not provided)\n\nTo enable `rust-analyzer`, you'll need to make Cargo build the project\nwith the `exercises` feature, which will automatically include the `exercises/`\nsubfolder in the project. The easiest way to do this is to tell your editor to\nbuild the project with all features (the equivalent of `cargo build --all-features`).\nFor specific editor instructions:\n\n- **VSCode**: Add a `.vscode/settings.json` file with the following:\n```json\n{\n    \"rust-analyzer.cargo.features\": [\"exercises\"]\n}\n```\n- **IntelliJ-based Editors**: Using the Rust plugin, everything should work\n    by default.\n- _Missing your editor? Feel free to contribute more instructions!_\n\n## Continuing On\n\nOnce 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.\n\n## Uninstalling Rustlings\n\nIf you want to remove Rustlings from your system, there's two steps. First, you'll need to remove the exercises folder that the install script created\nfor you:\n\n```bash\nrm -rf rustlings # or your custom folder name, if you chose and or renamed it\n```\n\nSecond, since Rustlings got installed via `cargo install`, it's only reasonable to assume that you can also remove it using Cargo, and\nexactly that is the case. Run `cargo uninstall` to remove the `rustlings` binary:\n\n```bash\ncargo uninstall rustlings\n```\n\nNow you should be done!\n\n## Completion\n\nRustlings isn't done; there are a couple of sections that are very experimental and don't have proper documentation. These include:\n\n- Errors (`exercises/errors/`)\n- Option (`exercises/option/`)\n- Result (`exercises/result/`)\n- Move Semantics (could still be improved, `exercises/move_semantics/`)\n\nAdditionally, we could use exercises on a couple of topics:\n\n- Structs\n- Better ownership stuff\n- `impl`\n- ??? probably more\n\nIf you are interested in improving or adding new ones, please feel free to contribute! Read on for more information :)\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Contributors ✨\n\nThanks goes to the wonderful people listed in [AUTHORS.md](./AUTHORS.md) 🎉\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimothyye%2Frustlings-solution","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimothyye%2Frustlings-solution","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimothyye%2Frustlings-solution/lists"}