firefly_audio/
error.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use core::fmt;

pub enum NodeError {
    TooManyChildren,
    TooManyNodes,
    UnknownID(u32),
}

impl fmt::Display for NodeError {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        match self {
            NodeError::TooManyChildren => write!(f, "the node has too many children"),
            NodeError::TooManyNodes => write!(f, "the tree has too many nodes"),
            NodeError::UnknownID(id) => write!(f, "there is no node with id {id}"),
        }
    }
}