From 23abd90fa6c49a46607471c623d36595aa22441d Mon Sep 17 00:00:00 2001 From: Znackt Date: Mon, 8 Jul 2024 20:42:08 +0530 Subject: [PATCH] fixed indentation --- src/editor.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/editor.rs b/src/editor.rs index fb17ed6..c3f38b5 100644 --- a/src/editor.rs +++ b/src/editor.rs @@ -6,7 +6,7 @@ pub struct Editor { impl Editor { pub fn default() -> Self { - Editor {should_quit: false} + Editor { should_quit: false } } pub fn run(&mut self) { if let Err(err) = self.repl() { @@ -19,10 +19,15 @@ impl Editor { enable_raw_mode()?; loop { if let Key(KeyEvent { - code, modifiers, kind, state + code, + modifiers, + kind, + state, }) = read()? { - println!("Code: {code:?} Modifiers: {modifiers:?} Kind: {kind:?} State: {state:?} \r"); + println!( + "Code: {code:?} Modifiers: {modifiers:?} Kind: {kind:?} State: {state:?} \r" + ); match code { Char('q') if modifiers == KeyModifiers::CONTROL => { self.should_quit = true; @@ -31,10 +36,10 @@ impl Editor { } if self.should_quit { break; - } + } } } disable_raw_mode()?; Ok(()) } -} \ No newline at end of file +}