File tree Expand file tree Collapse file tree 2 files changed +9
-13
lines changed Expand file tree Collapse file tree 2 files changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -225,19 +225,16 @@ impl Client {
225
225
. send ( ( buf, tx) )
226
226
. map_err ( err_to_others_err ! ( e, "Send packet to sender error " ) ) ?;
227
227
228
- let result: Result < Vec < u8 > > ;
229
- if req. timeout_nano == 0 {
230
- result = rx
231
- . recv ( )
232
- . map_err ( err_to_others_err ! ( e, "Receive packet from recver error: " ) ) ?;
228
+ let result = if req. timeout_nano == 0 {
229
+ rx. recv ( )
230
+ . map_err ( err_to_others_err ! ( e, "Receive packet from recver error: " ) ) ?
233
231
} else {
234
- result = rx
235
- . recv_timeout ( Duration :: from_nanos ( req. timeout_nano as u64 ) )
232
+ rx. recv_timeout ( Duration :: from_nanos ( req. timeout_nano as u64 ) )
236
233
. map_err ( err_to_others_err ! (
237
234
e,
238
235
"Receive packet from recver timeout: "
239
- ) ) ?;
240
- }
236
+ ) ) ?
237
+ } ;
241
238
242
239
let buf = result?;
243
240
let mut s = CodedInputStream :: from_bytes ( & buf) ;
Original file line number Diff line number Diff line change @@ -188,9 +188,8 @@ fn start_method_handler_thread(
188
188
trace ! ( "Got Message request {:?}" , req) ;
189
189
190
190
let path = format ! ( "/{}/{}" , req. service, req. method) ;
191
- let method;
192
- if let Some ( x) = methods. get ( & path) {
193
- method = x;
191
+ let method = if let Some ( x) = methods. get ( & path) {
192
+ x
194
193
} else {
195
194
let status = get_status ( Code :: INVALID_ARGUMENT , format ! ( "{} does not exist" , path) ) ;
196
195
let mut res = Response :: new ( ) ;
@@ -207,7 +206,7 @@ fn start_method_handler_thread(
207
206
break ;
208
207
}
209
208
continue ;
210
- }
209
+ } ;
211
210
let ctx = TtrpcContext {
212
211
fd,
213
212
mh,
You can’t perform that action at this time.
0 commit comments