summaryrefslogtreecommitdiff
path: root/src/widgets/statusbar.rs
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2024-08-01 22:07:04 +0200
committerNathan Reiner <nathan@nathanreiner.xyz>2024-08-01 22:07:04 +0200
commit1e1eb95926f556e666bc20355327abd24d264858 (patch)
treee40b68da80b984355baf68a36983d78bb2ec63dd /src/widgets/statusbar.rs
parent5d15bed762c4c699bebc9b5f5e302fa61785ed51 (diff)
minor cleanup
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;