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

Commit ea7a0c3

Browse files
authored
Merge pull request #1228 from Xanewok/revert-nll-workaround
Revert NLL bug workaround
2 parents 910457e + 8bbb9b1 commit ea7a0c3

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/server/mod.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ impl<O: Output> LsService<O> {
170170
}
171171
}
172172

173-
fn dispatch_message(&mut self, msg: RawMessage) -> Result<(), jsonrpc::Error> {
173+
fn dispatch_message(&mut self, msg: &RawMessage) -> Result<(), jsonrpc::Error> {
174174
macro_rules! match_action {
175175
(
176176
$method: expr;
@@ -334,12 +334,9 @@ impl<O: Output> LsService<O> {
334334
}
335335
}
336336

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

0 commit comments

Comments
 (0)