Remove useless .ok()

This commit is contained in:
Edward Shen 2022-05-09 01:39:09 -07:00
parent fdfb126c9c
commit 334a5fe076
Signed by: edward
GPG key ID: 19182661E818369F

View file

@ -190,11 +190,11 @@ async fn parse_message(event: SyncRoomMessageEvent, room: Joined) -> Result<()>
if let Some(message) = message.strip_prefix('!') {
let (command, args) = message.split_once(' ').unwrap_or((message, ""));
match BotCommand::from_str(command).ok() {
Some(BotCommand::Source) => source(room).await?,
Some(BotCommand::Uwu) => uwuify(room, args).await?,
Some(BotCommand::Ping) => ping(room).await?,
Some(BotCommand::Help) => help(room).await?,
match BotCommand::from_str(command) {
Ok(BotCommand::Source) => source(room).await?,
Ok(BotCommand::Uwu) => uwuify(room, args).await?,
Ok(BotCommand::Ping) => ping(room).await?,
Ok(BotCommand::Help) => help(room).await?,
_ => unsupported_command(event, room, command).await?,
}
}