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

Fix default idiom example #134

Closed RileyMShea closed 3 years ago

RileyMShea commented 3 years ago

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.

simonsan commented 3 years ago

Thank you! :-)