Resolve enum_glob_use pedantic clippy lint

warning: usage of wildcard import for enum variants
      --> src/main.rs:31:5
       |
    31 | use crate::opts::Coloring::*;
       |     ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate::opts::Coloring::{Always, Auto, Never}`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_glob_use
       = note: `-W clippy::enum-glob-use` implied by `-W clippy::pedantic`
       = help: to override `-W clippy::pedantic` add `#[allow(clippy::enum_glob_use)]`
This commit is contained in:
David Tolnay 2024-03-29 14:06:32 -07:00
parent 6373604bdb
commit 4bf1ebdbea
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82

View file

@ -28,7 +28,6 @@ mod version;
use crate::cmd::Line;
use crate::config::Config;
use crate::error::Result;
use crate::opts::Coloring::*;
use crate::opts::{Coloring, Expand, Subcommand};
use crate::unparse::unparse_maximal;
use crate::version::Version;
@ -262,9 +261,9 @@ fn do_cargo_expand() -> Result<i32> {
let theme = args.theme.or(config.theme);
let none_theme = theme.as_deref() == Some("none");
let do_color = match color {
Always => true,
Never => false,
Auto => !none_theme && io::stdout().is_terminal(),
Coloring::Always => true,
Coloring::Never => false,
Coloring::Auto => !none_theme && io::stdout().is_terminal(),
};
let _ = writeln!(io::stderr());
if do_color {