Skip to content

Commit 0c1e59c

Browse files
authored
Remove Result from ShardRunner::recv's return type (#3004)
With the change of `ShardRunner::request_restart`'s return type to remove the `Result` since it didn't return an `Err(...)` case ever, the `Result` in the return type of `ShardRunner::recv` can be similarly removed.
1 parent 8ff5965 commit 0c1e59c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/gateway/bridge/shard_runner.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ impl ShardRunner {
100100

101101
loop {
102102
trace!("[ShardRunner {:?}] loop iteration started.", self.shard.shard_info());
103-
if !self.recv().await? {
103+
if !self.recv().await {
104104
return Ok(());
105105
}
106106

@@ -352,12 +352,12 @@ impl ShardRunner {
352352
// happen, as the sending half is kept on the runner.
353353
// Returns whether the shard runner is in a state that can continue.
354354
#[instrument(skip(self))]
355-
async fn recv(&mut self) -> Result<bool> {
355+
async fn recv(&mut self) -> bool {
356356
loop {
357357
match self.runner_rx.try_next() {
358358
Ok(Some(value)) => {
359359
if !self.handle_rx_value(value).await {
360-
return Ok(false);
360+
return false;
361361
}
362362
},
363363
Ok(None) => {
@@ -367,15 +367,15 @@ impl ShardRunner {
367367
);
368368

369369
self.request_restart().await;
370-
return Ok(false);
370+
return false;
371371
},
372372
Err(_) => break,
373373
}
374374
}
375375

376376
// There are no longer any values available.
377377

378-
Ok(true)
378+
true
379379
}
380380

381381
/// Returns a received event, as well as whether reading the potentially present event was

0 commit comments

Comments
 (0)