on master help sign in
Simplify handle_terminal_events signature
commitadb6cd537628308a23fe6ea86f1c7b419c4d8c68 authorBlaž Hrastnik <blaz@mxxn.io> dateTue 26 Oct 2021, 18:02 (5 years ago) parent0623a72
1 file changed+5−6
helix-term/src/application.rs+5−6
helix-term/src/application.rs+5−6
@@ -213,7 +213,7 @@ impl Application {
213213 tokio::select! {
214214 biased;
215215
216− event = reader.next() => {
216+ Some(event) = reader.next() => {
217217 self.handle_terminal_events(event)
218218 }
219219 Some(signal) = self.signals.next() => {
@@ -351,7 +351,7 @@ impl Application {
351351 }
352352 }
353353
354− pub fn handle_terminal_events(&mut self, event: Option<Result<Event, crossterm::ErrorKind>>) {
354+ pub fn handle_terminal_events(&mut self, event: Result<Event, crossterm::ErrorKind>) {
355355 let mut cx = crate::compositor::Context {
356356 editor: &mut self.editor,
357357 jobs: &mut self.jobs,
@@ -359,15 +359,14 @@ impl Application {
359359 };
360360 // Handle key events
361361 let should_redraw = match event {
362− Some(Ok(Event::Resize(width, height))) => {
362+ Ok(Event::Resize(width, height)) => {
363363 self.compositor.resize(width, height);
364364
365365 self.compositor
366366 .handle_event(Event::Resize(width, height), &mut cx)
367367 }
368− Some(Ok(event)) => self.compositor.handle_event(event, &mut cx),
369− Some(Err(x)) => panic!("{}", x),
370− None => panic!(),
368+ Ok(event) => self.compositor.handle_event(event, &mut cx),
369+ Err(x) => panic!("{}", x),
371370 };
372371
373372 if should_redraw && !self.editor.should_close() {