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.95k stars 362 forks source link

Use a problem as the intro for newtype pattern #153

Closed pickfire closed 3 years ago

pickfire commented 3 years ago

A problem can highlight some of the use cases of newtype pattern rather than discussing generally that rust is strongly typed. Make the user understand the need of newtype.

I wonder if it should be in the description instead?

Continued https://github.com/rust-unofficial/patterns/pull/117

r? @simonsan

simonsan commented 3 years ago

Nice, thank you! :-)