File: most_simple.rs

package info (click to toggle)
rust-colored 3.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 468 kB
  • sloc: makefile: 2
file content (24 lines) | stat: -rw-r--r-- 581 bytes parent folder | download | duplicates (28)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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);
}