diff options
author | Igor Aleksanov <[email protected]> | 2020-08-10 13:50:27 +0100 |
---|---|---|
committer | Igor Aleksanov <[email protected]> | 2020-08-10 13:50:27 +0100 |
commit | d180b8bbe8c9e31953069bae387b5214fbb51d64 (patch) | |
tree | e0ad4602d20fbce320f763f19bf95ab5ec5649a0 | |
parent | 6344a7f362b19eaf71547766135ece160aa3389e (diff) |
Revert boxing for large enum variant
-rw-r--r-- | crates/flycheck/src/lib.rs | 7 |
1 files 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 { | |||
106 | cargo_handle: Option<CargoHandle>, | 106 | cargo_handle: Option<CargoHandle>, |
107 | } | 107 | } |
108 | 108 | ||
109 | #[allow(clippy::large_enum_variant)] | ||
109 | enum Event { | 110 | enum Event { |
110 | Restart(Restart), | 111 | Restart(Restart), |
111 | CheckEvent(Option<Box<cargo_metadata::Message>>), | 112 | CheckEvent(Option<cargo_metadata::Message>), |
112 | } | 113 | } |
113 | 114 | ||
114 | impl FlycheckActor { | 115 | impl FlycheckActor { |
@@ -123,7 +124,7 @@ impl FlycheckActor { | |||
123 | let check_chan = self.cargo_handle.as_ref().map(|cargo| &cargo.receiver); | 124 | let check_chan = self.cargo_handle.as_ref().map(|cargo| &cargo.receiver); |
124 | select! { | 125 | select! { |
125 | recv(inbox) -> msg => msg.ok().map(Event::Restart), | 126 | recv(inbox) -> msg => msg.ok().map(Event::Restart), |
126 | recv(check_chan.unwrap_or(&never())) -> msg => Some(Event::CheckEvent(msg.ok().map(Box::new))), | 127 | recv(check_chan.unwrap_or(&never())) -> msg => Some(Event::CheckEvent(msg.ok())), |
127 | } | 128 | } |
128 | } | 129 | } |
129 | fn run(mut self, inbox: Receiver<Restart>) { | 130 | fn run(mut self, inbox: Receiver<Restart>) { |
@@ -149,7 +150,7 @@ impl FlycheckActor { | |||
149 | let res = cargo_handle.join(); | 150 | let res = cargo_handle.join(); |
150 | self.send(Message::Progress(Progress::DidFinish(res))); | 151 | self.send(Message::Progress(Progress::DidFinish(res))); |
151 | } | 152 | } |
152 | Event::CheckEvent(Some(message)) => match *message { | 153 | Event::CheckEvent(Some(message)) => match message { |
153 | cargo_metadata::Message::CompilerArtifact(msg) => { | 154 | cargo_metadata::Message::CompilerArtifact(msg) => { |
154 | self.send(Message::Progress(Progress::DidCheckCrate(msg.target.name))); | 155 | self.send(Message::Progress(Progress::DidCheckCrate(msg.target.name))); |
155 | } | 156 | } |