Drop Error suffix from enum values to avoid the enum_variant_names clippy lint

This commit is contained in:
Michael Vines
2021-06-18 11:47:40 -07:00
committed by mergify[bot]
parent 2b39eb6412
commit 4a12c715a3
12 changed files with 77 additions and 76 deletions

View File

@@ -21,10 +21,10 @@ pub enum StreamerError {
Io(#[from] std::io::Error),
#[error("receive timeout error")]
RecvTimeoutError(#[from] RecvTimeoutError),
RecvTimeout(#[from] RecvTimeoutError),
#[error("send packets error")]
SendError(#[from] SendError<Packets>),
Send(#[from] SendError<Packets>),
}
pub type Result<T> = std::result::Result<T, StreamerError>;
@@ -148,8 +148,8 @@ pub fn responder(name: &'static str, sock: Arc<UdpSocket>, r: PacketReceiver) ->
loop {
if let Err(e) = recv_send(&sock, &r) {
match e {
StreamerError::RecvTimeoutError(RecvTimeoutError::Disconnected) => break,
StreamerError::RecvTimeoutError(RecvTimeoutError::Timeout) => (),
StreamerError::RecvTimeout(RecvTimeoutError::Disconnected) => break,
StreamerError::RecvTimeout(RecvTimeoutError::Timeout) => (),
_ => {
errors += 1;
last_error = Some(e);