diff options
Diffstat (limited to 'src/tools/clippy/src/docs/enum_glob_use.txt')
-rw-r--r-- | src/tools/clippy/src/docs/enum_glob_use.txt | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/tools/clippy/src/docs/enum_glob_use.txt b/src/tools/clippy/src/docs/enum_glob_use.txt new file mode 100644 index 000000000..3776822c3 --- /dev/null +++ b/src/tools/clippy/src/docs/enum_glob_use.txt @@ -0,0 +1,24 @@ +### What it does +Checks for `use Enum::*`. + +### Why is this bad? +It is usually better style to use the prefixed name of +an enumeration variant, rather than importing variants. + +### Known problems +Old-style enumerations that prefix the variants are +still around. + +### Example +``` +use std::cmp::Ordering::*; + +foo(Less); +``` + +Use instead: +``` +use std::cmp::Ordering; + +foo(Ordering::Less) +```
\ No newline at end of file |