Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1228 from Xanewok/revert-nll-workaround
Browse files Browse the repository at this point in the history
Revert NLL bug workaround
  • Loading branch information
Xanewok authored Jan 9, 2019
2 parents 910457e + 8bbb9b1 commit ea7a0c3
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ impl<O: Output> LsService<O> {
}
}

fn dispatch_message(&mut self, msg: RawMessage) -> Result<(), jsonrpc::Error> {
fn dispatch_message(&mut self, msg: &RawMessage) -> Result<(), jsonrpc::Error> {
macro_rules! match_action {
(
$method: expr;
Expand Down Expand Up @@ -334,12 +334,9 @@ impl<O: Output> LsService<O> {
}
}

// Workaround https://github.com/rust-lang/rust/pull/55937 by moving
// raw_message instead of borrowing.
let id = raw_message.id.clone();
if let Err(e) = self.dispatch_message(raw_message) {
if let Err(e) = self.dispatch_message(&raw_message) {
error!("dispatch error: {:?}, message: `{}`", e, msg_string);
self.output.failure(id, e);
self.output.failure(raw_message.id, e);
return ServerStateChange::Break { exit_code: 101 };
}

Expand Down

0 comments on commit ea7a0c3

Please sign in to comment.