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
simonsan bc49bb4e37
Fixing outdated link to rust-postgress (#121)
* Fixing outdated link to rust-postgress

Fixes #98

* Remove newline

Co-authored-by: Marco Ieni <11428655+MarcoIeni@users.noreply.github.com>
4 years ago
.github/workflows Add doc tests to CI (#124) 4 years ago
anti_patterns Add doc tests to CI (#124) 4 years ago
functional Add introductions (#117) 4 years ago
idioms Add doc tests to CI (#124) 4 years ago
patterns Add doc tests to CI (#124) 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
LICENSE Initial commit 9 years ago
README.md Fixing outdated link to rust-postgress (#121) 4 years ago
SUMMARY.md Add introductions (#117) 4 years ago
book.toml Adding mdbook configuration and deployment to gh-pages (#111) 4 years ago
intro.md Add introductions (#117) 4 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 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

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.

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.