PracticalRust / practical-rust

A book detailing common solutions to ordinary problems in Rust
MIT License
1 stars 0 forks source link

Enums vs Struct #5

Open connortess opened 2 years ago

connortess commented 2 years ago

when should you use an enum and when should you use a struct different use cases how matching works for both returning enums and structs

vlmutolo commented 2 years ago

I'd file this under "Rust fundamentals". This kind of information should really go in the Rust Book. I think Practical Rust should be focused on ways to solve common high-level problems, like how to serialize data, run a basic HTTP service, set up authentication, make a quick CLI tool, etc.