m-ou-se / rust-atomics-and-locks

Code examples, data structures, and links from my book, Rust Atomics and Locks.
Other
1.33k stars 120 forks source link

refactor: Replace if-else with match #56

Closed DannyCeb closed 2 months ago

DannyCeb commented 2 months ago

Using the Match pattern is more idiomatic and easy to understand

m-ou-se commented 2 months ago

These examples are exact copies of what is printed in the book. Considering there are already thousands of printed copies of the book, I prefer to leave things unchanged unless there are serious bugs that need fixing. ^^