From 3ae040f1fcded2a1df1aba7ed5f018c191a1bada Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Tue, 3 Sep 2019 16:20:00 -0400 Subject: [PATCH] Code format cleanup --- src/editor.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/editor.rs b/src/editor.rs index e326274..2dadcda 100644 --- a/src/editor.rs +++ b/src/editor.rs @@ -158,7 +158,7 @@ impl Editor { // -------------------------------------------------------------------- // Match escape sequence // -------------------------------------------------------------------- - let mut seq = [0;4]; + let mut seq = [0; 4]; br.read_exact(&mut seq); let seq_str = String::from_utf8(seq.to_vec()); @@ -278,7 +278,11 @@ impl Editor { // Input // ------------------------------------------------------------------------ - fn prompt(&mut self, prompt: &str, cb: Option<&mut dyn Fn(&mut Self, &str, EditorKey)>) -> String { + fn prompt( + &mut self, + prompt: &str, + cb: Option<&mut dyn Fn(&mut Self, &str, EditorKey)>, + ) -> String { let mut buffer = String::new(); let default_cb = &mut Self::_noop_prompt_cb; @@ -298,10 +302,10 @@ impl Editor { match char { Backspace => { buffer.pop(); - }, + } DeleteKey => { buffer.pop(); - }, + } Escape => { self.set_status_message(""); cb(self, &String::from(""), char); @@ -683,7 +687,7 @@ impl Editor { } fn row_rx_to_cx(&mut self, index: usize, rx: usize) -> usize { - let mut current_rx:usize = 0; + let mut current_rx: usize = 0; let mut cx: usize = 0; let row = &mut self.rows[index]; @@ -870,7 +874,7 @@ impl Editor { self.filename = self.prompt("Save as (ESC to cancel):", None); if self.filename.len() == 0 { self.set_status_message("Save aborted"); - return Ok(()) + return Ok(()); } }