diff options
author | Aleksey Kladov <[email protected]> | 2018-12-06 18:03:39 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-12-06 18:03:39 +0000 |
commit | f6e8b376d1d21b8b697de5ef1e35a341855202ed (patch) | |
tree | 395282e236ea516d4ed57e4771d3aae4eba0029b /crates/ra_lsp_server/src/main.rs | |
parent | e477b8745542d5ac85b2cbbb3be2eb0df22486cd (diff) |
modernize more
Diffstat (limited to 'crates/ra_lsp_server/src/main.rs')
-rw-r--r-- | crates/ra_lsp_server/src/main.rs | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/crates/ra_lsp_server/src/main.rs b/crates/ra_lsp_server/src/main.rs index a50ac76ff..9ba972562 100644 --- a/crates/ra_lsp_server/src/main.rs +++ b/crates/ra_lsp_server/src/main.rs | |||
@@ -1,11 +1,5 @@ | |||
1 | #[macro_use] | 1 | use serde_derive::Deserialize; |
2 | extern crate log; | 2 | use serde::Deserialize as _D; |
3 | #[macro_use] | ||
4 | extern crate failure; | ||
5 | #[macro_use] | ||
6 | extern crate serde_derive; | ||
7 | |||
8 | use serde::Deserialize; | ||
9 | use flexi_logger::{Duplicate, Logger}; | 3 | use flexi_logger::{Duplicate, Logger}; |
10 | use gen_lsp_server::{run_server, stdio_transport}; | 4 | use gen_lsp_server::{run_server, stdio_transport}; |
11 | use ra_lsp_server::Result; | 5 | use ra_lsp_server::Result; |
@@ -17,15 +11,15 @@ fn main() -> Result<()> { | |||
17 | .log_to_file() | 11 | .log_to_file() |
18 | .directory("log") | 12 | .directory("log") |
19 | .start()?; | 13 | .start()?; |
20 | info!("lifecycle: server started"); | 14 | log::info!("lifecycle: server started"); |
21 | match ::std::panic::catch_unwind(main_inner) { | 15 | match ::std::panic::catch_unwind(main_inner) { |
22 | Ok(res) => { | 16 | Ok(res) => { |
23 | info!("lifecycle: terminating process with {:?}", res); | 17 | log::info!("lifecycle: terminating process with {:?}", res); |
24 | res | 18 | res |
25 | } | 19 | } |
26 | Err(_) => { | 20 | Err(_) => { |
27 | error!("server panicked"); | 21 | log::error!("server panicked"); |
28 | bail!("server panicked") | 22 | failure::bail!("server panicked") |
29 | } | 23 | } |
30 | } | 24 | } |
31 | } | 25 | } |
@@ -56,8 +50,8 @@ fn main_inner() -> Result<()> { | |||
56 | ra_lsp_server::main_loop(false, root, publish_decorations, r, s) | 50 | ra_lsp_server::main_loop(false, root, publish_decorations, r, s) |
57 | }, | 51 | }, |
58 | )?; | 52 | )?; |
59 | info!("shutting down IO..."); | 53 | log::info!("shutting down IO..."); |
60 | threads.join()?; | 54 | threads.join()?; |
61 | info!("... IO is down"); | 55 | log::info!("... IO is down"); |
62 | Ok(()) | 56 | Ok(()) |
63 | } | 57 | } |