diff options
author | Aleksey Kladov <[email protected]> | 2018-08-10 21:56:19 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-08-10 21:56:19 +0100 |
commit | 52de08330f5052a1f10c5d46e1352ca86b622d71 (patch) | |
tree | 9f1adb749b2e4e344192e7060fcde8c748feede1 /crates/server/src/main.rs | |
parent | bf42a75f1e9a86247067611fadbed48ea9d379b0 (diff) |
dedupe
Diffstat (limited to 'crates/server/src/main.rs')
-rw-r--r-- | crates/server/src/main.rs | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/crates/server/src/main.rs b/crates/server/src/main.rs index f521271fb..dfde8afb1 100644 --- a/crates/server/src/main.rs +++ b/crates/server/src/main.rs | |||
@@ -28,12 +28,10 @@ use threadpool::ThreadPool; | |||
28 | use crossbeam_channel::{bounded, Sender, Receiver}; | 28 | use crossbeam_channel::{bounded, Sender, Receiver}; |
29 | use flexi_logger::Logger; | 29 | use flexi_logger::Logger; |
30 | use languageserver_types::{TextDocumentItem, VersionedTextDocumentIdentifier, TextDocumentIdentifier}; | 30 | use languageserver_types::{TextDocumentItem, VersionedTextDocumentIdentifier, TextDocumentIdentifier}; |
31 | use serde::{ser::Serialize, de::DeserializeOwned}; | ||
32 | use libanalysis::{WorldState, World}; | 31 | use libanalysis::{WorldState, World}; |
33 | 32 | ||
34 | use ::{ | 33 | use ::{ |
35 | io::{Io, RawMsg, RawRequest}, | 34 | io::{Io, RawMsg, RawRequest}, |
36 | req::Request, | ||
37 | handlers::{handle_syntax_tree, handle_extend_selection, publish_diagnostics}, | 35 | handlers::{handle_syntax_tree, handle_extend_selection, publish_diagnostics}, |
38 | }; | 36 | }; |
39 | 37 | ||
@@ -261,17 +259,13 @@ fn main_loop( | |||
261 | } | 259 | } |
262 | } | 260 | } |
263 | 261 | ||
264 | fn handle_request_on_threadpool<R>( | 262 | fn handle_request_on_threadpool<R: req::ClientRequest>( |
265 | req: &mut Option<RawRequest>, | 263 | req: &mut Option<RawRequest>, |
266 | pool: &ThreadPool, | 264 | pool: &ThreadPool, |
267 | world: &WorldState, | 265 | world: &WorldState, |
268 | sender: &Sender<Thunk>, | 266 | sender: &Sender<Thunk>, |
269 | f: fn(World, R::Params) -> Result<R::Result>, | 267 | f: fn(World, R::Params) -> Result<R::Result>, |
270 | ) -> Result<()> | 268 | ) -> Result<()> |
271 | where | ||
272 | R: Request + Send + 'static, | ||
273 | R::Params: DeserializeOwned + Send + 'static, | ||
274 | R::Result: Serialize + Send + 'static, | ||
275 | { | 269 | { |
276 | dispatch::handle_request::<R, _>(req, |params, resp| { | 270 | dispatch::handle_request::<R, _>(req, |params, resp| { |
277 | let world = world.snapshot(); | 271 | let world = world.snapshot(); |