]> git.lizzy.rs Git - rust.git/blob - src/docs/enum_glob_use.txt
[Arithmetic] Consider literals
[rust.git] / src / docs / enum_glob_use.txt
1 ### What it does
2 Checks for `use Enum::*`.
3
4 ### Why is this bad?
5 It is usually better style to use the prefixed name of
6 an enumeration variant, rather than importing variants.
7
8 ### Known problems
9 Old-style enumerations that prefix the variants are
10 still around.
11
12 ### Example
13 ```
14 use std::cmp::Ordering::*;
15
16 foo(Less);
17 ```
18
19 Use instead:
20 ```
21 use std::cmp::Ordering;
22
23 foo(Ordering::Less)
24 ```