diff options
author | Christian Duerr <contact@christianduerr.com> | 2018-05-11 20:22:36 +0200 |
---|---|---|
committer | Joe Wilm <jwilm@users.noreply.github.com> | 2018-05-11 16:54:19 -0700 |
commit | e34dccdabf210612666cbb9d22d7afff23487eaf (patch) | |
tree | 01cfc895cf42fc3f31427cc4543ab62265af3eb8 /src/event.rs | |
parent | 57281363503ddd1ebb373ed5de2b84c79d5aa3aa (diff) | |
download | alacritty-e34dccdabf210612666cbb9d22d7afff23487eaf.tar.gz alacritty-e34dccdabf210612666cbb9d22d7afff23487eaf.zip |
Fix clippy lints
Diffstat (limited to 'src/event.rs')
-rw-r--r-- | src/event.rs | 21 |
1 files changed, 10 insertions, 11 deletions
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)); + }); + } + } } } |