diff options
Diffstat (limited to 'vendor/colored/examples/most_simple.rs')
-rwxr-xr-x | vendor/colored/examples/most_simple.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/vendor/colored/examples/most_simple.rs b/vendor/colored/examples/most_simple.rs new file mode 100755 index 000000000..b94a2b36a --- /dev/null +++ b/vendor/colored/examples/most_simple.rs @@ -0,0 +1,24 @@ +extern crate colored; + +use colored::*; + +fn main() { + // TADAA ! + println!( + "{} {} {}!", + "it".green(), + "works".blue().bold(), + "great".bold().yellow() + ); + + println!("{}", String::from("this also works!").green().bold()); + + let mut s = String::new(); + s.push_str(&"why not ".red().to_string()); + s.push_str(&"push things ".blue().to_string()); + s.push_str(&"a little further ?".green().to_string()); + println!("{}", s); + + let s = format!("{} {} {}", "this".red(), "is".blue(), "easier".green()); + println!("{}", s); +} |