mre/idiomatic-rust
mre/idiomatic-rust has 7,907 GitHub stars and 244 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-08 07:13 UTC. Last push 2026-02-12.
๐ฆ A peer-reviewed collection of articles/talks/repos which teach concise, idiomatic Rust.
Measured star growth
- in 24h
- 0
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Original
This repository collects resources for writing clean, idiomatic Rust code. You can find a sortable/searchable version of this list here.
Idiomatic coding means following the conventions of a given language. It is the most concise, convenient, and common way of accomplishing a task in that language, rather than forcing it to work in a way the author is familiar with from a different language. - Adapted from Tim Mansfield
Contributions welcome! To add missing resources, please refer to the contributing documentation.
โ Projects
- blessed.rs โ An unofficial guide to the Rust ecosystem. Suggestions for popular, well-maintained crates.
- Canonical's Rust Best Practices โ A curated collection of best practices for writing Rust code, covering coding standards from naming conventions to unsafe code usage.
- cheats.rs - Idiomatic Rust tips โ A list of quick tips to make your code more idiomatic.
- clippy โ A bunch of lints to catch common mistakes and improve your Rust code.
- Elements of Rust โ A collection of software engineering techniques for effectively expressing intent with Rust.
- Patterns โ A catalogue of design patterns in Rust.
- Possible Rust โ A blog for intermediate Rust programmers exploring real-world code and design patterns.
- Rust Anthology โ The best short-form writing about Rust, collected.
- Rust API Guidelines โ An extensive list of recommendations for idiomatic Rust APIs.
- Rust by Example โ A community driven collection of example code which follow Rust best practices.
๐ Workshops
- Build your own JIRA with Rust โ A test-driven workshop to learn Rust by building your own JIRA clone!
- Comprehensive Rust โ A four day Rust course developed by the Android team, covering all aspects of Rust.
- Ferrous Systems Teaching Material โ Free workshop material produced by Ferrous Systems for trainings.
- Hecto: Build your own text editor in Rust โ This is a series of blog posts that shows you how to build a text editor in Rust
- Idiomatic Rust Workshop โ A talk/workshop about idiomatic Rust code focusing on effective use of existing syntax and design patterns
- PingCAP talent plan โ A series of training courses about writing distributed systems in Rust.
- Procedural Macros Workshop โ A selection of projects designed to learn to write Rust procedural macros.
- Rust 101 โ A Rust University course by tweede golf.
- Rust Development at Sentry โ A document containing useful resources for getting started with Rust and adhering to Sentry coding principles.
- rust-lang/rustlings โ Small exercises to get you used to reading and writing Rust code.
๐ Books
- Command Line Applications in Rust โ A tutorial on how to write CLI apps in Rust, learning many aspects of the ecosystem.
- Command-Line Rust โ Learn the language by writing Rust versions of common Unix coreutils.
- Discover the world of microcontrollers through Rust! โ An introductory course on microcontroller-based embedded systems using Rust.
- High Assurance Rust โ Developing secure and robust software, focusing on embedded-friendly data structures in Rust.
- Idiomatic Rust Snippets โ Beginner-friendly guide to core Rust conceptsโone of the best cheat sheets for Rust developers.
- Programming Rust: Fast, Safe Systems Development โ A comprehensive Rust Programming Guide that covers most of Rust's features in detail.
- Rust Atomics and Locks โ Helps Rust programmers of all levels gain a clear understanding of low-level concurrency.
- Rust Cookbook โ Examples that demonstrate good practices to accomplish common programming tasks in Rust.
- Rust for Rustaceans โ Covers how to design reliable, idiomatic, and ergonomic Rust programs based on best principles.
๐ฐ Articles
2025
- Level Up your Rust pattern matching โ Advanced pattern matching techniques and idiomatic usage.
- Be Simple โ Advocates for simpler, more maintainable code in Rust.
- Pitfalls of Safe Rust โ Essential guide to avoiding pitfalls even in safe Rust code.
- Flattening Rust's Learning Curve โ Best practices for learning Rust and reducing adoption friction.
- Patterns for Defensive Programming in Rust โ Defensive coding in Rust with best practices.
- Prototyping in Rust โ Rapid development methodology and idiomatic practices showing how to prototype effectively in Rust.
- Cancelling async Rust โ Guide to cancellation safety in async Rust with patterns for resource management.
- To panic or not to panic โ Error handling strategies and when panicking is appropriate versus returning Result types.
- Designing Error Types in Rust Libraries โ Approaches to structuring error handling in library APIs for clarity and usability.
2024
- The Mediocre Programmer's Guide to Rust โ Practical Rust without perfectionism - a pragmatic development approach.
- Rust's Sneaky Deadlock With if let Blocks โ Subtle lock holding pattern that can cause critical deadlock pitfalls.
- Rust Iterators Beyond the Basics โ Advanced iterator patterns for functional programming in Rust.
- The Ultimate Guide to Rust Newtypes โ Using newtypes for type safety and compile-time domain validation.
- How to Build Abstractions in Rust Applications โ Building effective abstractions in Rust based on software design principles.
- Don't Worry About Lifetimes โ Demystifying lifetime annotations with practical lifetime management patterns.
- When should I use String vs &str? โ Guidance on choosing the right string type - a fundamental idiomatic Rust pattern.
- Async Rust can be a pleasure to work with (without Send + Sync + 'static) โ Relaxing trait bounds for simpler async code and ergonomic async patterns for single-threaded contexts.
- Why choose async/await over threads? โ Guidance on when to use async vs traditional threading to choose the right concurrency model.
- Three Kinds Of Unwrap โ Understanding when and how to use different unwrap variants to prevent common panic-related bugs.
- Practical guide to Error Handling in Rust โ Hands-on guide with practical examples for common error handling scenarios in real-world applications.
2023
- Aim For Immutability in Rust โ Explains why variables are immutable in Rust by default.
- Compile-Time Invariants in Rust โ Shows how macros can be used to enforce invariants at compile-time.
2021
- Rust Number Conversion: Don't Follow the Book... โ A blog post discussing the best practices for number conversion in Rust.
- Hexagonal architecture in Rust โ Describes how to build a Rust service using domain driven design and a test-first approach.
- Wrapping errors in Rust โ Wrapping 'reqwest::Error' and a custom error type as an enum to make library usage easier.
- Aiming for idiomatic Rust โ Discusses different ways to solve a popular coding puzzle, 'balanced brackets', in Rust.
- Naming Your Lifetimes โ Explains how using longer, declarative lifetime names can help to disambiguate which borrow is which.
2020
- Are out parameters idiomatic in Rust? โ Discusses the pros and cons of functions returning a value vs. modifying a parameter in-place.
- Guide on how to write documentation for a Rust crate โ Writing good documentation with rustdoc including many examples.
- Learning Rust through open source and live code reviews โ Covers patterns like 'FromStr' and exposing a CLI and a library in one crate.
- Refactoring Rust Transpiled from C โ Describes how to lift a C-project that was automatically converted to unsafe Rust to safer, more idiomatic Rust.
- Context-preserving error handling โ Explains how to use crates like 'thiserror' in combination with 'map_err' to add context to errors.
2019
- Rust Patterns: Enums Instead Of Booleans โ Discusses how using enums instead of booleans can express intent more clearly in Rust.
- Taking string arguments in Rust โ Discussing how to avoid subtle issues with string handling and when to use 'str' vs 'String'.
- Await a minute โ Example code for moving from raw futures to async/await syntax to improve error handling.
2018
- Programming an ARM microcontroller in Rust at four different levels of abstraction โ Demonstrates how Rust helps to move from low-level embedded code to high-level abstractions.
2017
- The balance between cost, useability and soundness in C bindings, and Rust-SDL2's release โ Writing safe, sound, idiomatic libraries despite the limitations of the borrow checker.
- Math with distances in Rust: safety and correctness across units โ How to create a system to cleanly and safely do arithmetic with lengths.
- Lessons learned redesigning and refactoring a Rust Library โ 'RefCell', the builder pattern and more.
- Iteration patterns for Result & Option โ Explores how to filter and partition iterators of Result and Option types idiomatically.
2016
- Idiomatic tree and graph like structures in Rust โ Introduction to safe, dynamic, arena based tree structures without using lifetimes.
- Convenient and idiomatic conversions in Rust โ Explains 'From', 'Into', 'TryFrom', 'TryInto', 'AsRef' and 'AsMut' with practical examples.
- Rustic Bits โ Small things that make for rustic code.
- Ripgrep Code Review โ An analysis of the popular 'ripgrep' tool's source code.
- Pretty State Machine Patterns in Rust โ How to represent a State Machine in an expressive and understandable way in Rust.
- Teaching libraries through good documentation โ How to use the full power of Rust's documentation support (e.g. doc tests).
- Elegant Library APIs in Rust โ Many helpful tips and tricks for writing libraries in Rust.
- Russian Dolls and clean Rust code โ How to use the full power of 'Option' and 'Result' (especially 'and_then()' and 'unwrap_or()').
2015
- Rayon: data parallelism in Rust โ Writing elegant parallel code in Rust.
- Strategies for solving 'cannot move out of' borrowing errors in Rust โ Practical tips to help understand the borrow-checker and move semantics.
- Effectively Using Iterators In Rust โ Explanation of the 'Iter' and 'IntoIter' traits and how loops actually work in Rust.
- Creating a Rust function that returns a &str or String โ How 'Into' and 'Cow' (Clone-on-write) work together to avoid allocations for string types.
- Creating a Rust function that accepts String or &str โ How to make calling your code both ergonomic and fast (zero-allocation).
- Error Handling in Rust โ Understanding and handling errors in Rust in an idiomatic way.
- Rust traits for developer friendly libraries โ Thoughts about implementing good Rust libraries.
๐ค Talks
2024
- The Four Horsemen of Bad Rust Code โ A talk about common pitfalls in Rust code like overengineering and premature optimization. [Video]
2023
- Tricks of the Trait: Enabling Ergonomic Extractors โ Rust Nation UK, Feb. 2023 [Video]
2022
- Ergonomic APIs for hard problems โ RustLab Conference, October 2022 [Video]
- Nine Rules for Elegant Rust Library APIs โ Seattle Rust Meetup, Sep. 2022 [Video]
2020
- Macros for a More Productive Rust โ RustConf 2020 [Video]
2019
- Making Rust Delightful โ RustCon Asia 2019 [Video]
2018
- Idiomatic Rust - Writing Concise and Elegant Rust Code โ FOSDEM 2018 [Video]
2017
- Idiomatic Rust Libraries โ Rustfest Kiev [Video]
๐ฌ Forum
2020
2017
- An idiomatic way to sum up values in a multidimensional Array
- Which is more idiomatic? Functional, imperative or a mix?
๐ History
Coming from Python, I loved the guidelines on how idiomatic Python looks like. I was inspired by the likes of Peter Norvig, who wrote amazing articles on spellcheckers and sudoku solvers; and, of course, the Zen of Python. For Rust, there is no such thing as the Zen of Python, however, so I started collecting my own resources. The goal of this project is to create a peer-reviewed collection of articles/talks/repos, which teach idiomatic Rust style. It's a community project and you can contribute.
๐ License
To the extent possible under law, Matthias Endler has waived all copyright and related or neighboring rights to this work. Logo adapted from FreePik.com.
Explore related projects
codecrafters-io/build-your-own-x
Master programming by recreating your favorite technologies from scratch.
560,875 starspublic-apis/public-apis
A collective list of free APIs
497,120 starsmorluto/rea
Reverse engineer anything with agents, from app behavior down to native binaries.
441,926 starsopenclaw/openclaw
The AI that really does things. Any OS. Any Platform. The lobster way. ๐ฆ
394,168 stars