derail 0.3.0

An alternative to `core::error::Error`.
Documentation
//! `impl`s for [`Visitor`] that require [`core`].

use core::ops::ControlFlow;

use crate::{Error, VisitContext, Visitor};

impl<T> Visitor for &mut T
where
    T: Visitor + ?Sized,
{
    type Details = T::Details;

    fn visit(
        &mut self,
        visitee: &dyn Error<Details = Self::Details>,
        ctx: VisitContext<'_, Self::Details>,
    ) -> ControlFlow<()> {
        (**self).visit(visitee, ctx)
    }

    fn push(&mut self) -> ControlFlow<()> {
        (**self).push()
    }

    fn pop(&mut self) -> ControlFlow<()> {
        (**self).pop()
    }
}