there was a better way to do it
This commit is contained in:
parent
bcbc14ed17
commit
6446bb87db
@ -20,7 +20,7 @@ use std::collections::BTreeMap;
|
||||
pub struct AutolinkModule {}
|
||||
|
||||
impl AutolinkModule {
|
||||
pub fn new (_: &Table, config: &Table) -> Box<EventLoop> {
|
||||
pub fn new (_: &Table, _: &Table) -> Box<EventLoop> {
|
||||
Box::new(AutolinkModule {})
|
||||
}
|
||||
}
|
||||
@ -41,11 +41,8 @@ fn print_mtg_card (card: &MtgCard, message: &Message) {
|
||||
message.reply(&format!("*{}*", flavor));
|
||||
}
|
||||
|
||||
// 12 March 2017: Is there a better way to do this?
|
||||
if let Some(ref power) = card.power {
|
||||
if let Some(ref toughness) = card.toughness {
|
||||
message.reply(&format!("{}/{}", power, toughness));
|
||||
}
|
||||
if let (&Some(ref power), &Some(ref toughness)) = (&card.power, &card.toughness) {
|
||||
message.reply(&format!("{}/{}", power, toughness));
|
||||
}
|
||||
}
|
||||
|
||||
@ -68,10 +65,8 @@ fn print_ygo_card (card: &YugiohCard, message: &Message) {
|
||||
|
||||
message.reply(&format!("{}", card.text));
|
||||
|
||||
if let Some(ref atk) = card.atk {
|
||||
if let Some(ref def) = card.def {
|
||||
message.reply(&format!("{}/{}", atk, def));
|
||||
}
|
||||
if let (&Some(ref atk), &Some(ref def)) = (&card.atk, &card.def) {
|
||||
message.reply(&format!("{}/{}", atk, def));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user