lpxxn / rust-design-pattern

rust design patterns
Mozilla Public License 2.0
1.35k stars 110 forks source link

Fixes to the Singleton pattern #10

Closed ghost closed 4 years ago

ghost commented 4 years ago

Hi, I found some problems with your implementation of the Singleton pattern, so I made changes to make it similar to how the lazy_static! macro works and howstd::io initializes Stdin/Stdout/Stderr.