From d180b8bbe8c9e31953069bae387b5214fbb51d64 Mon Sep 17 00:00:00 2001 From: Igor Aleksanov Date: Mon, 10 Aug 2020 15:50:27 +0300 Subject: Revert boxing for large enum variant --- crates/flycheck/src/lib.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/flycheck/src/lib.rs b/crates/flycheck/src/lib.rs index 36e0e085a..ec769459c 100644 --- a/crates/flycheck/src/lib.rs +++ b/crates/flycheck/src/lib.rs @@ -106,9 +106,10 @@ struct FlycheckActor { cargo_handle: Option, } +#[allow(clippy::large_enum_variant)] enum Event { Restart(Restart), - CheckEvent(Option>), + CheckEvent(Option), } impl FlycheckActor { @@ -123,7 +124,7 @@ impl FlycheckActor { let check_chan = self.cargo_handle.as_ref().map(|cargo| &cargo.receiver); select! { recv(inbox) -> msg => msg.ok().map(Event::Restart), - recv(check_chan.unwrap_or(&never())) -> msg => Some(Event::CheckEvent(msg.ok().map(Box::new))), + recv(check_chan.unwrap_or(&never())) -> msg => Some(Event::CheckEvent(msg.ok())), } } fn run(mut self, inbox: Receiver) { @@ -149,7 +150,7 @@ impl FlycheckActor { let res = cargo_handle.join(); self.send(Message::Progress(Progress::DidFinish(res))); } - Event::CheckEvent(Some(message)) => match *message { + Event::CheckEvent(Some(message)) => match message { cargo_metadata::Message::CompilerArtifact(msg) => { self.send(Message::Progress(Progress::DidCheckCrate(msg.target.name))); } -- cgit v1.2.3