From 4f5f8efc96dc107bda344dec7f66f34eb7e86502 Mon Sep 17 00:00:00 2001 From: Dom Sec <54043553+dom-sec@users.noreply.github.com> Date: Thu, 23 Mar 2023 20:53:14 -0400 Subject: [PATCH] Delete hello_rainbow directory --- hello_rainbow/Cargo.toml | 9 --- hello_rainbow/src/colors.rs | 132 ------------------------------------ hello_rainbow/src/main.rs | 14 ---- 3 files changed, 155 deletions(-) delete mode 100644 hello_rainbow/Cargo.toml delete mode 100644 hello_rainbow/src/colors.rs delete mode 100644 hello_rainbow/src/main.rs diff --git a/hello_rainbow/Cargo.toml b/hello_rainbow/Cargo.toml deleted file mode 100644 index abe187e..0000000 --- a/hello_rainbow/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "hello_rainbow" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -termcolor = "1.2" diff --git a/hello_rainbow/src/colors.rs b/hello_rainbow/src/colors.rs deleted file mode 100644 index 0741137..0000000 --- a/hello_rainbow/src/colors.rs +++ /dev/null @@ -1,132 +0,0 @@ -use std::io::{Write}; -use termcolor::{Color, ColorChoice, ColorSpec, WriteColor, StandardStream}; - -pub fn print_green(text: &str) { - // Create a color specification for green - let mut spec = ColorSpec::new(); - spec.set_fg(Some(Color::Green)); - - // Create a standard stream for writing to the console - let mut stdout = StandardStream::stdout(ColorChoice::Always); - - // Write the text to the console with the green color - stdout.set_color(&spec).unwrap(); - writeln!(&mut stdout, "{}", text).unwrap(); - - // Reset the color specification to the default - stdout.reset().unwrap(); -} - -pub fn print_black(text: &str) { - // Create a color specification for black - let mut spec = ColorSpec::new(); - spec.set_fg(Some(Color::Black)); - - // Create a standard stream for writing to the console - let mut stdout = StandardStream::stdout(ColorChoice::Always); - - // Write the text to the console with the green color - stdout.set_color(&spec).unwrap(); - writeln!(&mut stdout, "{}", text).unwrap(); - - // Reset the color specification to the default - stdout.reset().unwrap(); -} - -pub fn print_blue(text: &str) { - // Create a color specification for blue - let mut spec = ColorSpec::new(); - spec.set_fg(Some(Color::Blue)); - - // Create a standard stream for writing to the console - let mut stdout = StandardStream::stdout(ColorChoice::Always); - - // Write the text to the console with the green color - stdout.set_color(&spec).unwrap(); - writeln!(&mut stdout, "{}", text).unwrap(); - - // Reset the color specification to the default - stdout.reset().unwrap(); -} - -pub fn print_red(text: &str) { - // Create a color specification for red - let mut spec = ColorSpec::new(); - spec.set_fg(Some(Color::Red)); - - // Create a standard stream for writing to the console - let mut stdout = StandardStream::stdout(ColorChoice::Always); - - // Write the text to the console with the green color - stdout.set_color(&spec).unwrap(); - writeln!(&mut stdout, "{}", text).unwrap(); - - // Reset the color specification to the default - stdout.reset().unwrap(); -} - -pub fn print_cyan(text: &str) { - // Create a color specification for cyan - let mut spec = ColorSpec::new(); - spec.set_fg(Some(Color::Cyan)); - - // Create a standard stream for writing to the console - let mut stdout = StandardStream::stdout(ColorChoice::Always); - - // Write the text to the console with the green color - stdout.set_color(&spec).unwrap(); - writeln!(&mut stdout, "{}", text).unwrap(); - - // Reset the color specification to the default - stdout.reset().unwrap(); -} - -pub fn print_magenta(text: &str) { - // Create a color specification for magenta - let mut spec = ColorSpec::new(); - spec.set_fg(Some(Color::Magenta)); - - // Create a standard stream for writing to the console - let mut stdout = StandardStream::stdout(ColorChoice::Always); - - // Write the text to the console with the green color - stdout.set_color(&spec).unwrap(); - writeln!(&mut stdout, "{}", text).unwrap(); - - // Reset the color specification to the default - stdout.reset().unwrap(); -} - -pub fn print_yellow(text: &str) { - // Create a color specification for yellow - let mut spec = ColorSpec::new(); - spec.set_fg(Some(Color::Yellow)); - - // Create a standard stream for writing to the console - let mut stdout = StandardStream::stdout(ColorChoice::Always); - - // Write the text to the console with the green color - stdout.set_color(&spec).unwrap(); - writeln!(&mut stdout, "{}", text).unwrap(); - - // Reset the color specification to the default - stdout.reset().unwrap(); -} - -pub fn print_white(text: &str) { - // Create a color specification for white - let mut spec = ColorSpec::new(); - spec.set_fg(Some(Color::White)); - - // Create a standard stream for writing to the console - let mut stdout = StandardStream::stdout(ColorChoice::Always); - - // Write the text to the console with the green color - stdout.set_color(&spec).unwrap(); - writeln!(&mut stdout, "{}", text).unwrap(); - - // Reset the color specification to the default - stdout.reset().unwrap(); -} - - diff --git a/hello_rainbow/src/main.rs b/hello_rainbow/src/main.rs deleted file mode 100644 index 19dadfc..0000000 --- a/hello_rainbow/src/main.rs +++ /dev/null @@ -1,14 +0,0 @@ -mod colors; - -fn main() { - - colors::print_black("Hello Black!"); - colors::print_blue("Hello Blue!"); - colors::print_green("Hello Green!"); - colors::print_red("Hello Red!"); - colors::print_cyan("Hello Cyan!"); - colors::print_magenta("Hello Magenta!"); - colors::print_yellow("Hello Yellow!"); - colors::print_white("Hello White!"); - -}