refactor: clean up clippy warnings
This commit is contained in:
@@ -310,14 +310,14 @@ impl Channel {
|
||||
/// This returns a Result because the recipient name can't be determined here without a db call,
|
||||
/// which can't be done since this is models, which can't reference the database crate.
|
||||
///
|
||||
/// If it returns Err, you need to fetch the name from the db.
|
||||
pub fn name(&self) -> Result<&str, ()> {
|
||||
/// If it returns None, you need to fetch the name from the db.
|
||||
pub fn name(&self) -> Option<&str> {
|
||||
match self {
|
||||
Channel::DirectMessage { .. } => Err(()),
|
||||
Channel::SavedMessages { .. } => Ok("Saved Messages"),
|
||||
Channel::DirectMessage { .. } => None,
|
||||
Channel::SavedMessages { .. } => Some("Saved Messages"),
|
||||
Channel::TextChannel { name, .. }
|
||||
| Channel::Group { name, .. }
|
||||
| Channel::VoiceChannel { name, .. } => Ok(name),
|
||||
| Channel::VoiceChannel { name, .. } => Some(name),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user