diff options
author | Nathan Vegdahl | 2021-07-01 18:57:12 +0000 |
---|---|---|
committer | Nathan Vegdahl | 2021-07-02 02:06:52 +0000 |
commit | efa3389b6aa4e07982e1e902b0173d1daa4a301e (patch) | |
tree | ea0d826cf4f191422b56ee9a5e9b7dad650af296 /helix-term/src/compositor.rs | |
parent | 702a0491db0fef8ee15cd6fcff3138812da2c2aa (diff) |
Fix unused variable, parameter, and `mut` warnings in helix-term.
Diffstat (limited to 'helix-term/src/compositor.rs')
-rw-r--r-- | helix-term/src/compositor.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/helix-term/src/compositor.rs b/helix-term/src/compositor.rs index 46da04be..c3d6dee0 100644 --- a/helix-term/src/compositor.rs +++ b/helix-term/src/compositor.rs @@ -35,7 +35,7 @@ pub struct Context<'a> { pub trait Component: Any + AnyComponent { /// Process input events, return true if handled. - fn handle_event(&mut self, event: Event, ctx: &mut Context) -> EventResult { + fn handle_event(&mut self, _event: Event, _ctx: &mut Context) -> EventResult { EventResult::Ignored } // , args: () @@ -49,13 +49,13 @@ pub trait Component: Any + AnyComponent { fn render(&self, area: Rect, frame: &mut Surface, ctx: &mut Context); /// Get cursor position and cursor kind. - fn cursor(&self, area: Rect, ctx: &Editor) -> (Option<Position>, CursorKind) { + fn cursor(&self, _area: Rect, _ctx: &Editor) -> (Option<Position>, CursorKind) { (None, CursorKind::Hidden) } /// May be used by the parent component to compute the child area. /// viewport is the maximum allowed area, and the child should stay within those bounds. - fn required_size(&mut self, viewport: (u16, u16)) -> Option<(u16, u16)> { + fn required_size(&mut self, _viewport: (u16, u16)) -> Option<(u16, u16)> { // TODO: for scrolling, the scroll wrapper should place a size + offset on the Context // that way render can use it None @@ -79,7 +79,7 @@ pub struct Compositor { impl Compositor { pub fn new() -> Result<Self, Error> { let backend = CrosstermBackend::new(stdout()); - let mut terminal = Terminal::new(backend)?; + let terminal = Terminal::new(backend)?; Ok(Self { layers: Vec::new(), terminal, @@ -124,8 +124,7 @@ impl Compositor { } pub fn render(&mut self, cx: &mut Context) { - let area = self - .terminal + self.terminal .autoresize() .expect("Unable to determine terminal size"); |