File tree 1 file changed +5
-16
lines changed
1 file changed +5
-16
lines changed Original file line number Diff line number Diff line change @@ -155,17 +155,11 @@ impl ConnHandler {
155
155
known : bytes2bool ( & next_field ( & mut req. data ) ) ,
156
156
running : bytes2bool ( & next_field ( & mut req. data ) ) ,
157
157
numerator : String :: from_utf8 ( next_field ( & mut req. data ) . to_vec ( ) ) ?. parse ( ) ?,
158
- denominator : String :: from_utf8 ( next_field ( & mut req. data ) . to_vec ( ) )
159
- . unwrap ( )
160
- . parse ( )
161
- . unwrap ( ) ,
158
+ denominator : String :: from_utf8 ( next_field ( & mut req. data ) . to_vec ( ) ) ?. parse ( ) ?,
162
159
waiting : 0 ,
163
160
} ;
164
161
if req. ptype == STATUS_RES_UNIQUE {
165
- js. waiting = String :: from_utf8 ( next_field ( & mut req. data ) . to_vec ( ) )
166
- . unwrap ( )
167
- . parse ( )
168
- . unwrap ( ) ;
162
+ js. waiting = String :: from_utf8 ( next_field ( & mut req. data ) . to_vec ( ) ) ?. parse ( ) ?;
169
163
}
170
164
let tx = self . client_data . status_res_tx ( ) ;
171
165
runtime:: Handle :: current ( ) . spawn ( async move { tx. send ( js) . await } ) ;
@@ -206,14 +200,9 @@ impl ConnHandler {
206
200
} ,
207
201
WORK_FAIL => WorkUpdate :: Fail ( handle) ,
208
202
WORK_STATUS => {
209
- let numerator: usize = String :: from_utf8 ( ( & payload) . to_vec ( ) )
210
- . unwrap ( )
211
- . parse ( )
212
- . unwrap ( ) ;
213
- let denominator: usize = String :: from_utf8 ( next_field ( & mut data) . to_vec ( ) )
214
- . unwrap ( )
215
- . parse ( )
216
- . unwrap ( ) ;
203
+ let numerator: usize = String :: from_utf8 ( ( & payload) . to_vec ( ) ) ?. parse ( ) ?;
204
+ let denominator: usize =
205
+ String :: from_utf8 ( next_field ( & mut data) . to_vec ( ) ) ?. parse ( ) ?;
217
206
WorkUpdate :: Status {
218
207
handle : handle,
219
208
numerator : numerator,
You can’t perform that action at this time.
0 commit comments