From 2baa8dba876dacabbed20e28401aada37d00f9e0 Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Mon, 12 Jul 2021 16:16:50 +0300 Subject: [PATCH] chore: fix clippy warnings --- src/channels/mod.rs | 4 ++-- src/commands/start.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/channels/mod.rs b/src/channels/mod.rs index 5785891..91fe5b9 100644 --- a/src/channels/mod.rs +++ b/src/channels/mod.rs @@ -55,7 +55,7 @@ pub enum ChannelMode { impl ChannelMode { /// Converts enum to &str - pub fn to_str(&self) -> &str { + pub fn as_str(&self) -> &str { match self { #[cfg(feature = "search")] ChannelMode::Search => "search", @@ -71,7 +71,7 @@ impl ChannelMode { impl fmt::Display for ChannelMode { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> std::result::Result<(), fmt::Error> { - write!(f, "{}", self.to_str()) + write!(f, "{}", self.as_str()) } } diff --git a/src/commands/start.rs b/src/commands/start.rs index 907620a..dd0f5a5 100644 --- a/src/commands/start.rs +++ b/src/commands/start.rs @@ -39,7 +39,7 @@ impl StreamCommand for StartCommand { } if let Some(caps) = RE.captures(&message) { - if self.mode.to_str() != &caps["mode"] { + if self.mode.as_str() != &caps["mode"] { Err(Error::new(ErrorKind::SwitchMode)) } else { let protocol_version: usize =