summaryrefslogtreecommitdiff
path: root/src/widgets/statusbar.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/statusbar.rs')
-rw-r--r--src/widgets/statusbar.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/widgets/statusbar.rs b/src/widgets/statusbar.rs
index 60b58a6..c8d52e5 100644
--- a/src/widgets/statusbar.rs
+++ b/src/widgets/statusbar.rs
@@ -6,7 +6,7 @@ use ratatui::{
widgets::Widget,
};
-#[derive(Clone)]
+#[derive(Clone, Default)]
pub struct StatusBar {
left: String,
left_style: Style,
@@ -125,11 +125,11 @@ impl StatusBar {
}
pub fn input(&self) -> Option<&str> {
- self.input.as_ref().map(|s| s.as_str())
+ self.input.as_deref()
}
pub fn area(&self, rect: Rect) -> Rect {
- let mut inner = rect.clone();
+ let mut inner = rect;
inner.height -= 1;
inner
}
@@ -162,9 +162,9 @@ impl StatusBar {
area.y += area.height - 1;
area.height = 1;
- let mut left = area.clone();
- let mut right = area.clone();
- let mut middle = area.clone();
+ let mut left = area;
+ let mut right = area;
+ let mut middle = area;
left.width = self.left.len() as u16;
right.width = self.right.len() as u16;