You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Go to file
Nick Cameron 6ac851e718 Add the extensibility by privacy pattern
(And change the concatenation pattern to say something different about perf)
9 years ago
anti_patterns Deref polymorphism anti-pattern 9 years ago
idioms Add the extensibility by privacy pattern 9 years ago
patterns Composing structs 9 years ago
LICENSE Initial commit 9 years ago
README.md Add the extensibility by privacy pattern 9 years ago
intro.md Initial commit 9 years ago
template.md Added a few idioms and patterns - some are still WIP 9 years ago

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

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.

Correction and elaboration PRs are very welcome.