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

Fix a few nits. #34

Closed CasualX closed 8 years ago

CasualX commented 8 years ago

Change the match guard to be part of the pattern.

Change "".to_string() to a more idiomatic String::new() to create a new String without memory allocation.

Via reddit.

nrc commented 8 years ago

Thank you!