colored-rs / colored

(Rust) Coloring terminal so simple you already know how to do it !
Mozilla Public License 2.0
1.74k stars 84 forks source link

fix usage of wildcard import #165

Closed aidantomcy closed 9 months ago

aidantomcy commented 9 months ago

In the following code in the readme,

 extern crate colored; // not needed in Rust 2018+

    use colored::*;

    // test the example with `cargo run --example most_simple`
    fn main() {
        // TADAA!
        println!("{} {} !", "it".green(), "works".blue().bold());
    }

there is a wildcard import. Wouldn't it be better to use just colored::Colorize instead?

Running clippy with the following flags: cargo clippy --workspace --all-targets --all-features -- -D warnings - W clippy::pedantic
gives an error and suggests using colored::Colorize instead. I hope this pr is fine.