#[non_exhaustive]
#[derive(Debug, Clone, PartialEq, thiserror::Error)]
pub enum TreeError {
#[error("operation requires a classification tree")]
NotClassificationTree,
#[error("corrupt tree structure: {0}")]
CorruptStructure(
&'static str,
),
}
#[cfg(test)]
mod tests {
use super::TreeError;
use crate::error::Error;
#[test]
fn display_tree_transparent_forwards_inner() {
let inner = TreeError::NotClassificationTree;
assert_eq!(
inner.to_string(),
"operation requires a classification tree"
);
let outer: Error = Error::from(TreeError::NotClassificationTree);
assert_eq!(outer.to_string(), inner.to_string());
}
}