1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::Spell;
use std::fmt;

/// An error when attempting to convert a spell into a sub-set of spells (footprints or paint).
#[derive(Debug)]
pub struct TryFromSpellError {
    pub defindex: u32,
    pub value: Spell,
}

impl fmt::Display for TryFromSpellError {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "No value matching `{}` for attribute `{}`", self.value, self.defindex)
    }
}