zero-pad ID for yugipedia links

This commit is contained in:
kageru 2023-08-07 09:38:52 +02:00
parent 2056b9b9f2
commit 2446aefba1

@ -66,7 +66,7 @@ pub struct Set {
impl Card { impl Card {
pub fn extended_info(&self) -> Result<String, fmt::Error> { pub fn extended_info(&self) -> Result<String, fmt::Error> {
let mut s = String::with_capacity(1000); let mut s = String::with_capacity(1000);
write!(s, "<p><a href=\"https://db.ygorganization.com/search#card:{}\">Rulings</a> – <a href=\"https://yugipedia.com/wiki/{}\">Yugipedia</a></p>", &self.name, &self.id)?; write!(s, "<p><a href=\"https://db.ygorganization.com/search#card:{}\">Rulings</a> – <a href=\"https://yugipedia.com/wiki/{:08}\">Yugipedia</a></p>", &self.name, &self.id)?;
s.push_str("<h3>Printings:</h3>"); s.push_str("<h3>Printings:</h3>");
for printing in &self.card_sets { for printing in &self.card_sets {
write!(s, "{}: {} ({})", printing.set_name, printing.set_code, printing.set_rarity)?; write!(s, "{}: {} ({})", printing.set_name, printing.set_code, printing.set_rarity)?;