use super::super::variant::*;
use std::{error::*, fmt};
#[derive(Clone, Debug)]
pub struct MergeError<'own, AnnotatedT> {
pub cause: &'own Variant<AnnotatedT>,
}
impl<'own, AnnotatedT> MergeError<'own, AnnotatedT> {
pub fn new(cause: &'own Variant<AnnotatedT>) -> Self {
Self { cause }
}
}
impl<'own, AnnotatedT> fmt::Display for MergeError<'own, AnnotatedT> {
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(formatter, "merge: {}", self.cause)
}
}
impl<'own, AnnotatedT> Error for MergeError<'own, AnnotatedT> where AnnotatedT: fmt::Debug {}