diff --git a/src/entrypoint.rs b/src/entrypoint.rs index aace50a..80b0df8 100644 --- a/src/entrypoint.rs +++ b/src/entrypoint.rs @@ -17,7 +17,7 @@ pub fn main() { .short('H') .long("hands") .takes_value(false) - .about("TURNS 👏 YOUR 👏 TEXT 👏 INTO 👏 THIS"), + .about("TURNS \u{1f44f} YOUR \u{1f44f} TEXT \u{1f44f} INTO \u{1f44f} THIS"), ) .get_matches(); diff --git a/src/hands.rs b/src/hands.rs index f03a88d..ade4b01 100644 --- a/src/hands.rs +++ b/src/hands.rs @@ -1,27 +1,33 @@ +#[must_use] pub fn handify(input: &str) -> String { let input = input.to_uppercase(); let input = input.trim().to_owned(); - let mut input = input.replace(" ", " 👏 "); + let mut input = input.replace(" ", " \u{1f44f} "); if !input.is_empty() { - input = format!("👏 {} 👏", input); + input = format!("\u{1f44f} {} \u{1f44f}", input); } input } -#[test] -fn handify_test_no_trailing_spaces() { - let input = "hello world"; - assert_eq!(handify(input), "👏 HELLO 👏 WORLD 👏"); -} +#[cfg(test)] +mod test { + use super::*; -#[test] -fn handify_test_with_trailing_spaces() { - let input = " hello world "; - assert_eq!(handify(input), "👏 HELLO 👏 WORLD 👏") -} + #[test] + fn handify_test_no_trailing_spaces() { + let input = "hello world"; + assert_eq!(handify(input), "\u{1f44f} HELLO \u{1f44f} WORLD \u{1f44f}"); + } -#[test] -fn handify_test_empty_string() { - let input = ""; - assert_eq!(handify(input), ""); + #[test] + fn handify_test_with_trailing_spaces() { + let input = " hello world "; + assert_eq!(handify(input), "\u{1f44f} HELLO \u{1f44f} WORLD \u{1f44f}") + } + + #[test] + fn handify_test_empty_string() { + let input = ""; + assert_eq!(handify(input), ""); + } } diff --git a/src/lib.rs b/src/lib.rs index 79cf741..f64d227 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,8 @@ +#![warn( + clippy::all, + clippy::pedantic +)] + #[macro_use] extern crate prettytable; pub mod entrypoint; diff --git a/src/main.rs b/src/main.rs index ad93f38..5eba9f5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,3 @@ -use emojifier; - fn main() { emojifier::entrypoint::main(); }