aboutsummaryrefslogtreecommitdiff
path: root/src/gui/question.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/question.rs')
-rw-r--r--src/gui/question.rs14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/gui/question.rs b/src/gui/question.rs
index 851c0af..37101c1 100644
--- a/src/gui/question.rs
+++ b/src/gui/question.rs
@@ -77,7 +77,7 @@ pub fn ask<B: Backend>(
let formatted_input = match state.answer {
Answer::Write => format!("{}█", state.input),
- _ => state.input.clone()
+ _ => state.input.clone(),
};
let answer = Paragraph::new(util::center_vertically(chunks[2], &formatted_input))
.style(match state.answer {
@@ -160,7 +160,11 @@ pub fn ask<B: Backend>(
let mut words = state.input.split_whitespace().collect::<Vec<&str>>();
if words.len() > 0 {
words.truncate(words.len() - 1);
- state.input = format!("{}{}", words.join(" "), if words.len() > 0 {" " } else {""});
+ state.input = format!(
+ "{}{}",
+ words.join(" "),
+ if words.len() > 0 { " " } else { "" }
+ );
}
}
Key::Ctrl('c') => {
@@ -182,7 +186,11 @@ pub fn ask<B: Backend>(
state.answer = Answer::Difficulty { difficulty: *d }
}
}
- Key::Char('\n') => return Ok(Response::Answered { difficulty: selected }),
+ Key::Char('\n') => {
+ return Ok(Response::Answered {
+ difficulty: selected,
+ })
+ }
_ => {}
},
}