Skip to content

Commit

Permalink
box large enum variant
Browse files Browse the repository at this point in the history
  • Loading branch information
jelni committed Aug 26, 2024
1 parent 91cfa23 commit aeaa492
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/bot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ impl Bot {
));
}
MessageDestination::Dice { message } => {
self.run_task(dice_reply::execute(message, self.client_id));
self.run_task(dice_reply::execute(*message, self.client_id));
}
MessageDestination::MarkovChain { text } => {
markov_chain_manager::train(&mut self.state.markov_chain.lock().unwrap(), text);
Expand Down
4 changes: 2 additions & 2 deletions src/utilities/message_filters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::bot::Bot;

pub enum MessageDestination {
Command { command: Arc<CommandInstance>, arguments: String, context: CommandContext },
Dice { message: Message },
Dice { message: Box<Message> },
MarkovChain { text: String },
}

Expand Down Expand Up @@ -44,7 +44,7 @@ pub fn message_destination(
};

if let MessageContent::MessageDice(_) = message.content {
return Some(MessageDestination::Dice { message });
return Some(MessageDestination::Dice { message: Box::new(message) });
}

let Some(text) = telegram_utils::get_message_text(&message.content) else {
Expand Down

0 comments on commit aeaa492

Please sign in to comment.