From 51d381fb2b82ee56fa3bf7a4b1fb960e7f027380 Mon Sep 17 00:00:00 2001 From: Daniel Tomlinson Date: Tue, 24 Nov 2020 11:25:11 +0000 Subject: [PATCH] Auto stash before merge of "develop" and "origin/develop" --- src/entrypoint.rs | 2 +- src/hands.rs | 10 ++++++---- src/lib.rs | 5 +++++ src/main.rs | 2 -- 4 files changed, 12 insertions(+), 7 deletions(-) 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 1b4b51e..ade4b01 100644 --- a/src/hands.rs +++ b/src/hands.rs @@ -1,9 +1,10 @@ +#[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 } @@ -11,16 +12,17 @@ pub fn handify(input: &str) -> String { #[cfg(test)] mod test { use super::*; + #[test] fn handify_test_no_trailing_spaces() { let input = "hello world"; - assert_eq!(handify(input), "👏 HELLO 👏 WORLD 👏"); + assert_eq!(handify(input), "\u{1f44f} HELLO \u{1f44f} WORLD \u{1f44f}"); } #[test] fn handify_test_with_trailing_spaces() { let input = " hello world "; - assert_eq!(handify(input), "👏 HELLO 👏 WORLD 👏") + assert_eq!(handify(input), "\u{1f44f} HELLO \u{1f44f} WORLD \u{1f44f}") } #[test] 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(); }