diff options
author | Joris | 2025-02-07 11:37:33 +0100 |
---|---|---|
committer | Joris | 2025-02-07 11:37:33 +0100 |
commit | f7afa9cf50a9459f41146ca5cb009eab69b76c5f (patch) | |
tree | c459003eb8aaf600ce35b567f74dd01e83327485 /src/gui | |
parent | b24dda856ddc1317816f6ab156096528e23d724c (diff) |
Upgrade dependencies
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/message.rs | 2 | ||||
-rw-r--r-- | src/gui/question.rs | 7 |
2 files changed, 3 insertions, 6 deletions
diff --git a/src/gui/message.rs b/src/gui/message.rs index 61f57ba..3273b31 100644 --- a/src/gui/message.rs +++ b/src/gui/message.rs @@ -20,7 +20,7 @@ pub fn show<B: Backend>( .direction(Direction::Vertical) .margin(2) .constraints([Constraint::Length(1), Constraint::Percentage(50)].as_ref()) - .split(f.size()); + .split(f.area()); let d1 = util::title(title); f.render_widget(d1, chunks[0]); diff --git a/src/gui/question.rs b/src/gui/question.rs index 512ca49..2a42e57 100644 --- a/src/gui/question.rs +++ b/src/gui/question.rs @@ -50,7 +50,7 @@ pub fn ask<B: Backend>(terminal: &mut Terminal<B>, title: &str, card: &Card) -> ] .as_ref(), ) - .split(f.size()); + .split(f.area()); let d1 = util::title(title); f.render_widget(d1, chunks[0]); @@ -232,10 +232,7 @@ fn remove_whitespaces(input: &str) -> String { } fn remove_indications_and_phonetics(response: &str) -> &str { - response - .split(|c| c == '(' || c == '[') - .collect::<Vec<&str>>()[0] - .trim() + response.split(['(', '[']).collect::<Vec<&str>>()[0].trim() } fn extract_phonetics(response: &str) -> Option<String> { |