File tree Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Original file line number Diff line number Diff line change @@ -301,7 +301,6 @@ async fn handle_list_tags(msg: ListTagsMsg, tables: &impl ReadableTables) -> Act
301
301
} = msg;
302
302
let from = from. map ( Bound :: Included ) . unwrap_or ( Bound :: Unbounded ) ;
303
303
let to = to. map ( Bound :: Excluded ) . unwrap_or ( Bound :: Unbounded ) ;
304
- let mut res = Vec :: new ( ) ;
305
304
for item in tables. tags ( ) . range ( ( from, to) ) . context ( StorageSnafu ) ? {
306
305
match item {
307
306
Ok ( ( k, v) ) => {
@@ -312,23 +311,15 @@ async fn handle_list_tags(msg: ListTagsMsg, tables: &impl ReadableTables) -> Act
312
311
hash : v. hash ,
313
312
format : v. format ,
314
313
} ;
315
- res. push ( crate :: api:: Result :: Ok ( info) ) ;
314
+ if tx. send ( ListTagsItem :: Item ( info) ) . await . is_err ( ) {
315
+ return Ok ( ( ) ) ;
316
+ }
316
317
}
317
318
}
318
319
Err ( e) => {
319
- res. push ( Err ( crate :: api:: Error :: other ( e) ) ) ;
320
- }
321
- }
322
- }
323
- for item in res {
324
- match item {
325
- Ok ( tag_info) => {
326
- if tx. send ( ListTagsItem :: Item ( tag_info) ) . await . is_err ( ) {
327
- return Ok ( ( ) ) ;
328
- }
329
- }
330
- Err ( err) => {
331
- tx. send ( ListTagsItem :: Error ( err) ) . await . ok ( ) ;
320
+ tx. send ( ListTagsItem :: Error ( crate :: api:: Error :: other ( e) ) )
321
+ . await
322
+ . ok ( ) ;
332
323
return Ok ( ( ) ) ;
333
324
}
334
325
}
You can’t perform that action at this time.
0 commit comments