A catalogue of Rust design patterns
Switch branches/tags
Clone or download
lfairy Merge pull request #77 from rivertam/patch-1
Add reference to `derive_builder`
Latest commit 33fc597 Dec 22, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
anti_patterns Update deny-warnings.md Sep 9, 2018
idioms Fix a slight typo Dec 14, 2018
patterns Add reference to `derive_builder` Dec 19, 2018
LICENSE Initial commit Aug 30, 2015
README.md Merge pull request #48 from llogiq/default Dec 6, 2017
intro.md Initial commit Aug 30, 2015
template.md Added a few idioms and patterns - some are still WIP Oct 22, 2015

README.md

Rust Design Patterns

An open source repository of design patterns and idioms in the Rust programming language.

Contents

Introduction

Idioms

Design patterns

Anti-patterns

  • TODO thread + catch_panic for exceptions
  • TODO Clone to satisfy the borrow checker
  • Deref polymorphism
  • TODO Matching all fields of a struct (back compat)
  • TODO wildcard matches
  • TODO taking an enum rather than having multiple functions
  • TODO unwrap()ing every Result instead of forwarding it
  • #[deny(warnings)]

Contributing

Contributions are very welcome!

You should start with the template. Copy it into the appropriate directory, edit it, and submit a PR. You might not want every section, and you might want to add extra sections.

We suggest leaving a comment on the issue tracker so that other people don't start working on the same topic.

Correction and elaboration PRs are very welcome.