refactor(statusline): make clippy happy again

pull/2434/head
etienne-k 2 years ago
parent 1ccd1deafe
commit 1e9543953d

@ -35,27 +35,18 @@ impl<'a> RenderContext<'a> {
theme, theme,
focused, focused,
spinners, spinners,
buffer: RenderBuffer::new(), buffer: RenderBuffer::default(),
} }
} }
} }
#[derive(Default)]
pub struct RenderBuffer<'a> { pub struct RenderBuffer<'a> {
pub left: Spans<'a>, pub left: Spans<'a>,
pub center: Spans<'a>, pub center: Spans<'a>,
pub right: Spans<'a>, pub right: Spans<'a>,
} }
impl<'a> RenderBuffer<'a> {
pub fn new() -> Self {
Self {
left: Spans::default(),
center: Spans::default(),
right: Spans::default(),
}
}
}
pub struct StatusLine; pub struct StatusLine;
impl StatusLine { impl StatusLine {
@ -87,7 +78,7 @@ impl StatusLine {
let element_ids = &editor.config().status_line.left; let element_ids = &editor.config().status_line.left;
element_ids element_ids
.into_iter() .iter()
.map(|element_id| Self::get_render_function(*element_id)) .map(|element_id| Self::get_render_function(*element_id))
.for_each(|render| render(context, write_left)); .for_each(|render| render(context, write_left));
@ -102,7 +93,7 @@ impl StatusLine {
let element_ids = &editor.config().status_line.right; let element_ids = &editor.config().status_line.right;
element_ids element_ids
.into_iter() .iter()
.map(|element_id| Self::get_render_function(*element_id)) .map(|element_id| Self::get_render_function(*element_id))
.for_each(|render| render(context, write_right)); .for_each(|render| render(context, write_right));
@ -120,7 +111,7 @@ impl StatusLine {
let element_ids = &editor.config().status_line.center; let element_ids = &editor.config().status_line.center;
element_ids element_ids
.into_iter() .iter()
.map(|element_id| Self::get_render_function(*element_id)) .map(|element_id| Self::get_render_function(*element_id))
.for_each(|render| render(context, write_center)); .for_each(|render| render(context, write_center));

Loading…
Cancel
Save