From c898f9c89217a9fbb0c4c77126a454afe112ae05 Mon Sep 17 00:00:00 2001 From: Dhghomon <56599343+Dhghomon@users.noreply.github.com> Date: Sun, 21 Mar 2021 15:36:31 +0900 Subject: [PATCH] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b4f8290..f0d058c 100644 --- a/README.md +++ b/README.md @@ -11049,7 +11049,7 @@ Now the code looks like this: const OKAY_CHARACTERS: &str = "1234567890+- "; // Don't forget the space at the end fn math(input: &str) -> i32 { - if let false = input.chars().all(|character| OKAY_CHARACTERS.contains(character)) { + if !input.chars().all(|character| OKAY_CHARACTERS.contains(character)) { panic!("Please only input numbers, +-, or spaces"); } 6 // we still return a 6 for now @@ -11108,7 +11108,7 @@ First we just want to pass all the tests. After we pass the tests, we can "refac const OKAY_CHARACTERS: &str = "1234567890+- "; fn math(input: &str) -> i32 { - if let false = input.chars().all(|character| OKAY_CHARACTERS.contains(character)) { + if !input.chars().all(|character| OKAY_CHARACTERS.contains(character)) { panic!("Please only input numbers, +-, or spaces"); } @@ -11300,7 +11300,7 @@ impl Calculator { const OKAY_CHARACTERS: &str = "1234567890+- "; fn math(input: &str) -> i32 { - if let false = input.chars().all(|character| OKAY_CHARACTERS.contains(character)) { + if !input.chars().all(|character| OKAY_CHARACTERS.contains(character)) { panic!("Please only input numbers, +-, or spaces"); } @@ -11421,7 +11421,7 @@ impl Calculator { const OKAY_CHARACTERS: &str = "1234567890+- "; fn math(input: &str) -> i32 { - if let false = input.chars().all(|character| OKAY_CHARACTERS.contains(character)) { + if !input.chars().all(|character| OKAY_CHARACTERS.contains(character)) { panic!("Please only input numbers, +-, or spaces"); }