From ee4462881e2a0c9fdbb12fe0e33067e3052ef04d Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Thu, 4 Apr 2019 14:24:05 +0300 Subject: run cargo fmt --- ui/src/components/mail/listing/compact.rs | 18 ++++++++++++++---- ui/src/components/mail/listing/plain.rs | 11 ++++++++--- ui/src/components/mail/listing/thread.rs | 17 +++++++++++++---- 3 files changed, 35 insertions(+), 11 deletions(-) (limited to 'ui/src/components/mail/listing') diff --git a/ui/src/components/mail/listing/compact.rs b/ui/src/components/mail/listing/compact.rs index 17ab9e54..a748c372 100644 --- a/ui/src/components/mail/listing/compact.rs +++ b/ui/src/components/mail/listing/compact.rs @@ -275,7 +275,8 @@ impl CompactListing { /// Draw the list of `Envelope`s. fn draw_list(&mut self, grid: &mut CellBuffer, area: Area, context: &mut Context) { - if self.cursor_pos.1 != self.new_cursor_pos.1 || self.cursor_pos.0 != self.new_cursor_pos.0 { + if self.cursor_pos.1 != self.new_cursor_pos.1 || self.cursor_pos.0 != self.new_cursor_pos.0 + { self.refresh_mailbox(context); } let upper_left = upper_left!(area); @@ -484,11 +485,15 @@ impl Component for CompactListing { UIEventType::RefreshMailbox(_) => { self.dirty = true; } - UIEventType::MailboxUpdate((ref idxa, ref idxf)) if *idxa == self.new_cursor_pos.0 && *idxf == self.new_cursor_pos.1 => { + UIEventType::MailboxUpdate((ref idxa, ref idxf)) + if *idxa == self.new_cursor_pos.0 && *idxf == self.new_cursor_pos.1 => + { self.refresh_mailbox(context); self.set_dirty(); } - UIEventType::StartupCheck(ref f) if context.mailbox_hashes[f] == (self.new_cursor_pos.0, self.new_cursor_pos.1) => { + UIEventType::StartupCheck(ref f) + if context.mailbox_hashes[f] == (self.new_cursor_pos.0, self.new_cursor_pos.1) => + { self.refresh_mailbox(context); self.set_dirty(); } @@ -534,7 +539,12 @@ impl Component for CompactListing { false } fn is_dirty(&self) -> bool { - self.dirty || if self.unfocused { self.view.is_dirty() } else { false } + self.dirty + || if self.unfocused { + self.view.is_dirty() + } else { + false + } } fn set_dirty(&mut self) { if self.unfocused { diff --git a/ui/src/components/mail/listing/plain.rs b/ui/src/components/mail/listing/plain.rs index 16368f95..27801887 100644 --- a/ui/src/components/mail/listing/plain.rs +++ b/ui/src/components/mail/listing/plain.rs @@ -252,7 +252,8 @@ impl PlainListing { /// Draw the list of `Envelope`s. fn draw_list(&mut self, grid: &mut CellBuffer, area: Area, context: &mut Context) { - if self.cursor_pos.1 != self.new_cursor_pos.1 || self.cursor_pos.0 != self.new_cursor_pos.0 { + if self.cursor_pos.1 != self.new_cursor_pos.1 || self.cursor_pos.0 != self.new_cursor_pos.0 + { self.refresh_mailbox(context); } let upper_left = upper_left!(area); @@ -502,11 +503,15 @@ impl Component for PlainListing { self.dirty = true; self.view = None; } - UIEventType::MailboxUpdate((ref idxa, ref idxf)) if *idxa == self.new_cursor_pos.0 && *idxf == self.new_cursor_pos.1 => { + UIEventType::MailboxUpdate((ref idxa, ref idxf)) + if *idxa == self.new_cursor_pos.0 && *idxf == self.new_cursor_pos.1 => + { self.refresh_mailbox(context); self.set_dirty(); } - UIEventType::StartupCheck(ref f) if context.mailbox_hashes[f] == (self.new_cursor_pos.0, self.new_cursor_pos.1) => { + UIEventType::StartupCheck(ref f) + if context.mailbox_hashes[f] == (self.new_cursor_pos.0, self.new_cursor_pos.1) => + { self.refresh_mailbox(context); self.set_dirty(); } diff --git a/ui/src/components/mail/listing/thread.rs b/ui/src/components/mail/listing/thread.rs index 029e5a1c..d1f55aba 100644 --- a/ui/src/components/mail/listing/thread.rs +++ b/ui/src/components/mail/listing/thread.rs @@ -48,7 +48,11 @@ pub struct ThreadListing { impl ListingTrait for ThreadListing { fn coordinates(&self) -> (usize, usize, Option) { - (self.cursor_pos.0, self.cursor_pos.1, Some(self.locations[self.cursor_pos.2])) + ( + self.cursor_pos.0, + self.cursor_pos.1, + Some(self.locations[self.cursor_pos.2]), + ) } fn set_coordinates(&mut self, coordinates: (usize, usize, Option)) { self.new_cursor_pos = (coordinates.0, coordinates.1, 0); @@ -291,7 +295,8 @@ impl ThreadListing { /// Draw the list of `Envelope`s. fn draw_list(&mut self, grid: &mut CellBuffer, area: Area, context: &mut Context) { - if self.cursor_pos.1 != self.new_cursor_pos.1 || self.cursor_pos.0 != self.new_cursor_pos.0 { + if self.cursor_pos.1 != self.new_cursor_pos.1 || self.cursor_pos.0 != self.new_cursor_pos.0 + { self.refresh_mailbox(context); } let upper_left = upper_left!(area); @@ -660,11 +665,15 @@ impl Component for ThreadListing { self.dirty = true; self.view = None; } - UIEventType::MailboxUpdate((ref idxa, ref idxf)) if *idxa == self.new_cursor_pos.0 && *idxf == self.new_cursor_pos.1 => { + UIEventType::MailboxUpdate((ref idxa, ref idxf)) + if *idxa == self.new_cursor_pos.0 && *idxf == self.new_cursor_pos.1 => + { self.refresh_mailbox(context); self.set_dirty(); } - UIEventType::StartupCheck(ref f) if context.mailbox_hashes[f] == (self.new_cursor_pos.0, self.new_cursor_pos.1) => { + UIEventType::StartupCheck(ref f) + if context.mailbox_hashes[f] == (self.new_cursor_pos.0, self.new_cursor_pos.1) => + { self.refresh_mailbox(context); self.set_dirty(); } -- cgit v1.2.3