Skip to content

Commit 8a96815

Browse files
bors[bot]matklad
andauthored
Merge #5070
5070: minor r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
2 parents 3f2a596 + 1272e6c commit 8a96815

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

crates/rust-analyzer/src/global_state.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//!
44
//! Each tick provides an immutable snapshot of the state as `WorldSnapshot`.
55
6-
use std::sync::Arc;
6+
use std::{sync::Arc, time::Instant};
77

88
use crossbeam_channel::{unbounded, Receiver, Sender};
99
use flycheck::FlycheckHandle;
@@ -20,7 +20,7 @@ use crate::{
2020
diagnostics::{CheckFixes, DiagnosticCollection},
2121
from_proto,
2222
line_endings::LineEndings,
23-
main_loop::{ReqQueue, Task},
23+
main_loop::Task,
2424
reload::SourceRootConfig,
2525
request_metrics::{LatestRequests, RequestMetrics},
2626
show_message,
@@ -48,6 +48,9 @@ pub(crate) struct Handle<H, C> {
4848
pub(crate) receiver: C,
4949
}
5050

51+
pub(crate) type ReqHandler = fn(&mut GlobalState, lsp_server::Response);
52+
pub(crate) type ReqQueue = lsp_server::ReqQueue<(String, Instant), ReqHandler>;
53+
5154
/// `GlobalState` is the primary mutable state of the language server
5255
///
5356
/// The most interesting components are `vfs`, which stores a consistent

crates/rust-analyzer/src/main_loop.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -468,10 +468,6 @@ impl GlobalState {
468468
}
469469
}
470470

471-
pub(crate) type ReqHandler = fn(&mut GlobalState, Response);
472-
pub(crate) type ReqQueue = lsp_server::ReqQueue<(String, Instant), ReqHandler>;
473-
const DO_NOTHING: ReqHandler = |_, _| ();
474-
475471
#[derive(Eq, PartialEq)]
476472
enum Progress {
477473
Begin,
@@ -499,7 +495,7 @@ fn report_progress(
499495
let work_done_progress_create = global_state.req_queue.outgoing.register(
500496
lsp_types::request::WorkDoneProgressCreate::METHOD.to_string(),
501497
lsp_types::WorkDoneProgressCreateParams { token: token.clone() },
502-
DO_NOTHING,
498+
|_, _| (),
503499
);
504500
global_state.send(work_done_progress_create.into());
505501

0 commit comments

Comments
 (0)