Auto stash before merge of "develop" and "origin/develop"
This commit is contained in:
10
src/hands.rs
10
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]
|
||||
|
||||
Reference in New Issue
Block a user