diff options
author | Joris | 2022-09-12 08:47:09 +0200 |
---|---|---|
committer | Joris | 2022-09-12 08:47:09 +0200 |
commit | 11984f74c5785562a4aff210f50fd75dc3a97cb8 (patch) | |
tree | 0ec8507a4ffa06d5170ad29fc4b6b1a2d78c3b17 | |
parent | 20ba5a4363f977adaa1a811fb6e6771123cfb50d (diff) |
Trim input when checking responses
-rw-r--r-- | src/gui/question.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/question.rs b/src/gui/question.rs index 5f060e3..55c099d 100644 --- a/src/gui/question.rs +++ b/src/gui/question.rs @@ -169,6 +169,9 @@ pub fn ask<B: Backend>( } fn is_correct(input: &str, responses: &[String]) -> bool { + // Trim input + let input = input.trim(); + responses .iter() .map(|r| r.split('(').collect::<Vec<&str>>()[0].trim()) |