aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_proc_macro_srv/src/cli.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_proc_macro_srv/src/cli.rs')
-rw-r--r--crates/ra_proc_macro_srv/src/cli.rs15
1 files changed, 6 insertions, 9 deletions
diff --git a/crates/ra_proc_macro_srv/src/cli.rs b/crates/ra_proc_macro_srv/src/cli.rs
index c7f41e448..ded1bcdbc 100644
--- a/crates/ra_proc_macro_srv/src/cli.rs
+++ b/crates/ra_proc_macro_srv/src/cli.rs
@@ -4,16 +4,13 @@ use crate::{expand_task, list_macros};
4use ra_proc_macro::msg::{self, Message}; 4use ra_proc_macro::msg::{self, Message};
5use std::io; 5use std::io;
6 6
7pub fn run() { 7pub fn run() -> io::Result<()> {
8 loop { 8 loop {
9 let req = match read_request() { 9 // bubble up the error for read request,
10 Err(err) => { 10 // as the stdin pipe may be closed.
11 // Panic here, as the stdin pipe may be closed. 11 let req = match read_request()? {
12 // Otherwise, client will be restarted the service anyway. 12 None => continue,
13 panic!("Read message error on ra_proc_macro_srv: {}", err); 13 Some(req) => req,
14 }
15 Ok(None) => continue,
16 Ok(Some(req)) => req,
17 }; 14 };
18 15
19 let res = match req { 16 let res = match req {