rust-unofficial / patterns

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

Issue #91: Add example for example initialization #97

Closed tkaitchuck closed 4 years ago

tkaitchuck commented 4 years ago

Add example for https://github.com/rust-unofficial/patterns/issues/91

pickfire commented 4 years ago

After getting more understanding on this, I felt like this is more like a no_run replacement. I wonder if it would be better to leave this in the anti-pattern but mentioned that it is only useful for no_run since it is not good to not write assertions if we can.