colored-rs / colored

(Rust) Coloring terminal so simple you already know how to do it !

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Help] What's wrong with this?

szskill opened this issue · comments

I've checked almost everything, but it just doesn't work.

extern crate colored;

use colored::*;

fn main() {
    println!("abc123".green());
}

Somehow it only works with formats.

println! only takes string literals as the first argument.

// shouldn't compile
let s = "hello";
println!(s);
// should compile
println!("hello");