Skip to content

Commit

Permalink
silence clippy warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Marc-Antoine Perennou <[email protected]>
  • Loading branch information
Keruspe committed May 18, 2023
1 parent f20003b commit d01a56f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ impl Channel {
self.set_state(ChannelState::Closing);
if let Some(error) = error {
self.error_publisher_confirms(error.clone());
let _ = self.error_consumers(error); // ignore the error here, only happens with default executor if we cannot spawn a thread
self.error_consumers(error); // ignore the error here, only happens with default executor if we cannot spawn a thread
} else {
self.consumers.start_cancel();
}
Expand Down
9 changes: 3 additions & 6 deletions src/channel_status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,20 +112,17 @@ impl ChannelStatus {
}
}

#[derive(Clone, Debug, PartialEq, Eq)]
#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub enum ChannelState {
#[default]
Initial,
Connected,
Closing,
Closed,
Error,
}

impl Default for ChannelState {
fn default() -> Self {
ChannelState::Initial
}
}


impl fmt::Debug for ChannelStatus {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand Down
9 changes: 3 additions & 6 deletions src/connection_status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@ pub(crate) enum ConnectionStep {
Open(PromiseResolver<Connection>),
}

#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, Default, PartialEq)]
pub enum ConnectionState {
#[default]
Initial,
Connecting,
Connected,
Expand All @@ -106,11 +107,7 @@ pub enum ConnectionState {
Error,
}

impl Default for ConnectionState {
fn default() -> Self {
ConnectionState::Initial
}
}


impl fmt::Debug for ConnectionStatus {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand Down
4 changes: 2 additions & 2 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ impl error::Error for Error {
fn source(&self) -> Option<&(dyn error::Error + 'static)> {
match self {
Error::IOError(e) => Some(&**e),
Error::ParsingError(e) => Some(&*e),
Error::ProtocolError(e) => Some(&*e),
Error::ParsingError(e) => Some(e),
Error::ProtocolError(e) => Some(e),
Error::SerialisationError(e) => Some(&**e),
_ => None,
}
Expand Down

0 comments on commit d01a56f

Please sign in to comment.