refactor: remove panic on impossible error
Remove the logical complexity of error handling for an error that cannot occur. This was an artifact of pre-PR refactoring - the error being returned SHOULD never be reached, as the only error returned is the "your message is too big" error, and that's not possible because the message size is validated in the GossipHandle::broadcast() method before it reaches the reactor.pull/24376/head
parent
a686580ffa
commit
701da1363c
|
@ -213,15 +213,18 @@ where
|
|||
// The user is guaranteed MAX_USER_PAYLOAD_BYTES to
|
||||
// be send-able, so send this frame without packing
|
||||
// others with it for simplicity.
|
||||
if populate_frame(
|
||||
populate_frame(
|
||||
&mut self.cached_frame,
|
||||
vec![new_payload(Payload::UserData(proto::UserPayload{payload}))],
|
||||
&mut self.serialisation_buf
|
||||
).is_err()
|
||||
{
|
||||
continue
|
||||
}
|
||||
self.peer_list.broadcast(&self.serialisation_buf, &self.socket, &self.metric_frames_sent, &self.metric_bytes_sent).await;
|
||||
).expect("size validated in handle at enqueue time");
|
||||
|
||||
self.peer_list.broadcast(
|
||||
&self.serialisation_buf,
|
||||
&self.socket,
|
||||
&self.metric_frames_sent,
|
||||
&self.metric_bytes_sent
|
||||
).await;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue