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
Riley Shea 4017a73d62
Fix default idiom example (#134)
Before this change, the example code doesn't run on the current rust stable release(1.49).
This is because `Path` inherently has a u8 that requires the sized trait which requires either statics or replacing Path with PathBuf.

After this change, the example code will run "as-is" without warnings or errors.
4 years ago
.github/workflows Add doc tests to CI (#124) 4 years ago
anti_patterns Added information on --cap-lints to deny-warnings antipattern (#58) 4 years ago
functional Add introductions (#117) 4 years ago
idioms Fix default idiom example (#134) 4 years ago
patterns Update compose structs compile error example for NLL (#136) 4 years ago
refactoring Add introductions (#117) 4 years ago
.env Adding mdbook configuration and deployment to gh-pages (#111) 4 years ago
.gitignore Adding mdbook configuration and deployment to gh-pages (#111) 4 years ago
CONTRIBUTING.md Add explanation how to test the book to contributing (#139) 4 years ago
LICENSE Initial commit 9 years ago
README.md Fix typo in filename (#127) 4 years ago
SUMMARY.md Remove templated late bounds from summary (#142) 4 years ago
additional_resources.md Adding Nick Camerons talk at PDXRust 2016 to additional resources section (#102) 4 years ago
book.toml Adding mdbook configuration and deployment to gh-pages (#111) 4 years ago
intro.md Add direct links due to #130 (#131) 4 years ago
template.md Adding Contribution guide (#123) 4 years ago

README.md

Rust Design Patterns

An open source book about design patterns and idioms in the Rust programming language that you can read here.

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

You are missing content in this repository that can be helpful for others and you are eager to explain it? Awesome! We are always happy about new contributions (e.g. elaboration or corrections on certain topics) to this project.

We suggest reading our Contribution guide to get more information on how it works.

Building with mdbook

This book is built with mdbook. You can install it by running cargo install mdbook.

If you want to build it locally you can run one of these two commands in the root directory of the repository:

  • mdbook build

    Builds static html pages as output and place them in the /book directory by default.

  • mdbook serve

    Serves the book at http://localhost:3000 (port is changeable, take a look at the terminal output to be sure) and reloads the browser when a change occurs.

License

This content of this repository is licensed under MPL-2.0; see LICENSE.