mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Revert boxing for large enum variant
This commit is contained in:
parent
6344a7f362
commit
d180b8bbe8
1 changed files with 4 additions and 3 deletions
|
@ -106,9 +106,10 @@ struct FlycheckActor {
|
|||
cargo_handle: Option<CargoHandle>,
|
||||
}
|
||||
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
enum Event {
|
||||
Restart(Restart),
|
||||
CheckEvent(Option<Box<cargo_metadata::Message>>),
|
||||
CheckEvent(Option<cargo_metadata::Message>),
|
||||
}
|
||||
|
||||
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<Restart>) {
|
||||
|
@ -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)));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue