https://github.com/corrode/refactoring-rust
Writing Better Rust: a refactoring workshop
https://github.com/corrode/refactoring-rust
Last synced: about 1 month ago
JSON representation
Writing Better Rust: a refactoring workshop
- Host: GitHub
- URL: https://github.com/corrode/refactoring-rust
- Owner: corrode
- Created: 2026-05-18T06:44:33.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2026-05-19T19:25:50.000Z (2 months ago)
- Last Synced: 2026-05-19T22:57:51.904Z (2 months ago)
- Language: Rust
- Size: 2.68 MB
- Stars: 21
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Refactoring Rust
*Hands-on exercises for writing more idiomatic, maintainable Rust.*

With Rustlings and 100 exercises to learn Rust, there exist two excellent
resources for learning Rust.
What I found to be lacking was a more advanced course, which teaches Rust
idioms and patterns by means of refactoring exercises, for typical real-world
scenarios.
That's what "Refactoring Rust" is all about.
Each exercise asks you to take a small, working-but-awkward piece of code
and make it more idiomatic. There is typically more than one good answer.
The goal is not to be a definitive source of truth, but rather to give us
something concrete to talk about.
## Running an exercise
```sh
cargo run --example 01_starts_with_uppercase
cargo test --example 01_starts_with_uppercase
```
## Overview
The examples are numbered roughly by complexity. We'll start with quick
warm-ups everyone can finish in a few minutes and gradually move into
larger structural refactors. Feel free to skip around: each example is
self-contained.