From 3331cde357b01ffd37f7f0da50879409e369aaa9 Mon Sep 17 00:00:00 2001 From: gwenn <gtreguier@gmail.com> Date: Sun, 5 Aug 2018 08:20:03 +0200 Subject: [PATCH] Rustfmt --- src/history.rs | 11 +++++------ src/lib.rs | 3 ++- src/line_buffer.rs | 11 +++++------ src/tty/windows.rs | 7 +++---- src/undo.rs | 9 ++++----- 5 files changed, 19 insertions(+), 22 deletions(-) diff --git a/src/history.rs b/src/history.rs index 8cbcc230..60821d3b 100644 --- a/src/history.rs +++ b/src/history.rs @@ -57,12 +57,11 @@ impl History { return false; } if line.as_ref().is_empty() - || (self.ignore_space - && line - .as_ref() - .chars() - .next() - .map_or(true, |c| c.is_whitespace())) + || (self.ignore_space && line + .as_ref() + .chars() + .next() + .map_or(true, |c| c.is_whitespace())) { return false; } diff --git a/src/lib.rs b/src/lib.rs index 41f224d2..d93037d7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -194,7 +194,8 @@ fn page_completions<R: RawReader>( .into_iter() .map(|s| s.as_str().width()) .max() - .unwrap() + min_col_pad, + .unwrap() + + min_col_pad, ); let num_cols = cols / max_width; diff --git a/src/line_buffer.rs b/src/line_buffer.rs index fbe7239b..1e7ddc26 100644 --- a/src/line_buffer.rs +++ b/src/line_buffer.rs @@ -510,12 +510,11 @@ impl LineBuffer { CharSearch::BackwardAfter(c) => pos + c.len_utf8(), CharSearch::Forward(_) => shift + pos, CharSearch::ForwardBefore(_) => { - shift + pos - - self.buf[..shift + pos] - .chars() - .next_back() - .unwrap() - .len_utf8() + shift + pos - self.buf[..shift + pos] + .chars() + .next_back() + .unwrap() + .len_utf8() } }) } else { diff --git a/src/tty/windows.rs b/src/tty/windows.rs index cd483e70..5618f8c4 100644 --- a/src/tty/windows.rs +++ b/src/tty/windows.rs @@ -471,10 +471,9 @@ impl Term for Console { } let original_stdin_mode = try!(get_console_mode(self.stdin_handle)); // Disable these modes - let raw = original_stdin_mode - & !(wincon::ENABLE_LINE_INPUT - | wincon::ENABLE_ECHO_INPUT - | wincon::ENABLE_PROCESSED_INPUT); + let raw = original_stdin_mode & !(wincon::ENABLE_LINE_INPUT + | wincon::ENABLE_ECHO_INPUT + | wincon::ENABLE_PROCESSED_INPUT); // Enable these modes let raw = raw | wincon::ENABLE_EXTENDED_FLAGS; let raw = raw | wincon::ENABLE_INSERT_MODE; diff --git a/src/undo.rs b/src/undo.rs index 84c8f77e..333e5b49 100644 --- a/src/undo.rs +++ b/src/undo.rs @@ -177,11 +177,10 @@ impl Changeset { return; } - if !Self::single_char(string.as_ref()) - || !self - .undos - .last() - .map_or(false, |lc| lc.delete_seq(indx, string.as_ref().len())) + if !Self::single_char(string.as_ref()) || !self + .undos + .last() + .map_or(false, |lc| lc.delete_seq(indx, string.as_ref().len())) { self.undos.push(Change::Delete { idx: indx, -- GitLab