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 =