rust-unofficial / patterns

A catalogue of Rust design patterns, anti-patterns and idioms
https://rust-unofficial.github.io/patterns/
Mozilla Public License 2.0
8.11k stars 375 forks source link

rustdoc --test the examples #49

Closed llogiq closed 3 years ago

llogiq commented 7 years ago

I have a local branch here that does this. Obviously some examples are not meant to run (e.g. partial copies from std), those can be marked with ignore.

Otherwise examples should run if it doesn't make them unreadable. I consider adding one or two lines of use declarations acceptable.

Thoughts?

lambda-fairy commented 7 years ago

Good idea! I'd be keen for that, as long as new contributors are made aware of it.

cbreeden commented 7 years ago

I like it. It also may nudge us a little bit to make complete examples, which I'm in favor for.

llogiq commented 7 years ago

We can add a small sentence to the README. Also using Travis to check PRs will make it pretty obvious.

simonsan commented 3 years ago

We're using mdbook now to build the book and have CI running on PRs and pushes to master, so I'm closing this as this should catch these cases.