You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make code more idiomatic.
A person learning Rust for the first time seeing `use crate::Role::*` gets spun into a rabbit hole of:
- understanding what "crate::" means here
- is a single file a crate? (look it up in the docs)
- do even enums local to the file have to be specified with an absolute path from crate root?
Besides, `use crate:: ...` is taught in the example for use later on, which is linked to at the bottom of this document. Using this document to only teach about unpacking enums into the name space, and then using the other document to introduce `use crate::`, means less things need to be learned all at once, reducing confusion.
0 commit comments