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 {}
|
pub struct AutolinkModule {}
|
||||||
|
|
||||||
impl AutolinkModule {
|
impl AutolinkModule {
|
||||||
pub fn new (_: &Table, config: &Table) -> Box<EventLoop> {
|
pub fn new (_: &Table, _: &Table) -> Box<EventLoop> {
|
||||||
Box::new(AutolinkModule {})
|
Box::new(AutolinkModule {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -41,12 +41,9 @@ fn print_mtg_card (card: &MtgCard, message: &Message) {
|
|||||||
message.reply(&format!("*{}*", flavor));
|
message.reply(&format!("*{}*", flavor));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 12 March 2017: Is there a better way to do this?
|
if let (&Some(ref power), &Some(ref toughness)) = (&card.power, &card.toughness) {
|
||||||
if let Some(ref power) = card.power {
|
|
||||||
if let Some(ref toughness) = card.toughness {
|
|
||||||
message.reply(&format!("{}/{}", power, toughness));
|
message.reply(&format!("{}/{}", power, toughness));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn print_ygo_card (card: &YugiohCard, message: &Message) {
|
fn print_ygo_card (card: &YugiohCard, message: &Message) {
|
||||||
@ -68,11 +65,9 @@ fn print_ygo_card (card: &YugiohCard, message: &Message) {
|
|||||||
|
|
||||||
message.reply(&format!("{}", card.text));
|
message.reply(&format!("{}", card.text));
|
||||||
|
|
||||||
if let Some(ref atk) = card.atk {
|
if let (&Some(ref atk), &Some(ref def)) = (&card.atk, &card.def) {
|
||||||
if let Some(ref def) = card.def {
|
|
||||||
message.reply(&format!("{}/{}", atk, def));
|
message.reply(&format!("{}/{}", atk, def));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn print_any_link (link: &Link, message: &Message) {
|
fn print_any_link (link: &Link, message: &Message) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user