| 1 | extern crate coloredrust-analyzer cargo colored 3.1.1 colored/; |
| 2 | |
| 3 | use coloredrust-analyzer cargo colored 3.1.1 crate/::Colorizerust-analyzer cargo colored 3.1.1 Colorize#; |
| 4 | |
| 5 | fn mainrust-analyzer cargo colored 3.1.1 main().() { |
| 6 | // TADAA ! |
| 7 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!( |
| 8 | "{} {} {}!", |
| 9 | "it".greenrust-analyzer cargo colored 3.1.1 Colorize#green().(), |
| 10 | "works".bluerust-analyzer cargo colored 3.1.1 Colorize#blue().().boldrust-analyzer cargo colored 3.1.1 impl#[ColoredString][Colorize]bold().(), |
| 11 | "great".boldrust-analyzer cargo colored 3.1.1 impl#[`&str`][Colorize]bold().().yellowrust-analyzer cargo colored 3.1.1 Colorize#yellow().() |
| 12 | ); |
| 13 | |
| 14 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("{}", Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("this also works!").greenrust-analyzer cargo colored 3.1.1 Colorize#green().().boldrust-analyzer cargo colored 3.1.1 impl#[ColoredString][Colorize]bold().()); |
| 15 | |
| 16 | let mut s = Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]new().(); |
| 17 | s.push_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push_str().(&"why not ".redrust-analyzer cargo colored 3.1.1 Colorize#red().().to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()); |
| 18 | s.push_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push_str().(&"push things ".bluerust-analyzer cargo colored 3.1.1 Colorize#blue().().to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()); |
| 19 | s.push_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push_str().(&"a little further ?".greenrust-analyzer cargo colored 3.1.1 Colorize#green().().to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()); |
| 20 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("{s}"); |
| 21 | |
| 22 | let s = formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{} {} {}", "this".redrust-analyzer cargo colored 3.1.1 Colorize#red().(), "is".bluerust-analyzer cargo colored 3.1.1 Colorize#blue().(), "easier".greenrust-analyzer cargo colored 3.1.1 Colorize#green().()); |
| 23 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("{s}"); |
| 24 | } |