From 11984f74c5785562a4aff210f50fd75dc3a97cb8 Mon Sep 17 00:00:00 2001 From: Joris Date: Mon, 12 Sep 2022 08:47:09 +0200 Subject: Trim input when checking responses --- src/gui/question.rs | 3 +++ 1 file changed, 3 insertions(+) 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( } fn is_correct(input: &str, responses: &[String]) -> bool { + // Trim input + let input = input.trim(); + responses .iter() .map(|r| r.split('(').collect::>()[0].trim()) -- cgit v1.2.3