aboutsummaryrefslogtreecommitdiffstats
path: root/src/command/client/search
diff options
context:
space:
mode:
Diffstat (limited to 'src/command/client/search')
-rw-r--r--src/command/client/search/history_list.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/command/client/search/history_list.rs b/src/command/client/search/history_list.rs
index e4d8ee6b..fda1098f 100644
--- a/src/command/client/search/history_list.rs
+++ b/src/command/client/search/history_list.rs
@@ -35,14 +35,11 @@ impl<'a> StatefulWidget for HistoryList<'a> {
type State = ListState;
fn render(mut self, area: Rect, buf: &mut Buffer, state: &mut Self::State) {
- let list_area = match self.block.take() {
- Some(b) => {
- let inner_area = b.inner(area);
- b.render(area, buf);
- inner_area
- }
- None => area,
- };
+ let list_area = self.block.take().map_or(area, |b| {
+ let inner_area = b.inner(area);
+ b.render(area, buf);
+ inner_area
+ });
if list_area.width < 1 || list_area.height < 1 || self.history.is_empty() {
return;