fparkan/vendor/thiserror/src/provide.rs
Valentin Popov 1b6a04ca55
Initial vendor packages
Signed-off-by: Valentin Popov <valentin@popov.link>
2024-01-08 01:21:28 +04:00

21 lines
416 B
Rust

use std::error::{Error, Request};
#[doc(hidden)]
pub trait ThiserrorProvide: Sealed {
fn thiserror_provide<'a>(&'a self, request: &mut Request<'a>);
}
impl<T> ThiserrorProvide for T
where
T: Error + ?Sized,
{
#[inline]
fn thiserror_provide<'a>(&'a self, request: &mut Request<'a>) {
self.provide(request);
}
}
#[doc(hidden)]
pub trait Sealed {}
impl<T: Error + ?Sized> Sealed for T {}