File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -4,16 +4,13 @@ use crate::{expand_task, list_macros};
4
4
use ra_proc_macro:: msg:: { self , Message } ;
5
5
use std:: io;
6
6
7
- pub fn run ( ) {
7
+ pub fn run ( ) -> io :: Result < ( ) > {
8
8
loop {
9
- let req = match read_request ( ) {
10
- Err ( err) => {
11
- // Panic here, as the stdin pipe may be closed.
12
- // Otherwise, client will be restarted the service anyway.
13
- panic ! ( "Read message error on ra_proc_macro_srv: {}" , err) ;
14
- }
15
- Ok ( None ) => continue ,
16
- Ok ( Some ( req) ) => req,
9
+ // bubble up the error for read request,
10
+ // as the stdin pipe may be closed.
11
+ let req = match read_request ( ) ? {
12
+ None => continue ,
13
+ Some ( req) => req,
17
14
} ;
18
15
19
16
let res = match req {
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ fn setup_logging() -> Result<()> {
66
66
}
67
67
68
68
fn run_proc_macro_srv ( ) -> Result < ( ) > {
69
- ra_proc_macro_srv:: cli:: run ( ) ;
69
+ ra_proc_macro_srv:: cli:: run ( ) ? ;
70
70
Ok ( ( ) )
71
71
}
72
72
You can’t perform that action at this time.
0 commit comments