From e34dccdabf210612666cbb9d22d7afff23487eaf Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Fri, 11 May 2018 20:22:36 +0200 Subject: Fix clippy lints --- src/event.rs | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src/event.rs') diff --git a/src/event.rs b/src/event.rs index d85fab2b..a4ca5365 100644 --- a/src/event.rs +++ b/src/event.rs @@ -57,17 +57,16 @@ impl<'a, N: Notify + 'a> input::ActionContext for ActionContext<'a, N> { fn copy_selection(&self, buffer: ::copypasta::Buffer) { if let Some(ref selection) = *self.selection { - selection.to_span(self.terminal) - .map(|span| { - let buf = self.terminal.string_from_selection(&span); - if !buf.is_empty() { - Clipboard::new() - .and_then(|mut clipboard| clipboard.store(buf, buffer)) - .unwrap_or_else(|err| { - warn!("Error storing selection to clipboard. {}", Red(err)); - }); - } - }); + if let Some(ref span) = selection.to_span(self.terminal) { + let buf = self.terminal.string_from_selection(&span); + if !buf.is_empty() { + Clipboard::new() + .and_then(|mut clipboard| clipboard.store(buf, buffer)) + .unwrap_or_else(|err| { + warn!("Error storing selection to clipboard. {}", Red(err)); + }); + } + } } } -- cgit v1.2.3-54-g00ecf