mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-26 00:00:23 +02:00
Clean up RequestParts API (#167)
In http-body 0.4.3 `BoxBody` implements `Default`. This allows us to clean up the API of `RequestParts` quite a bit.
This commit is contained in:
@@ -13,6 +13,16 @@ impl Error {
|
||||
inner: error.into(),
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn downcast<T>(self) -> Result<T, Self>
|
||||
where
|
||||
T: StdError + 'static,
|
||||
{
|
||||
match self.inner.downcast::<T>() {
|
||||
Ok(t) => Ok(*t),
|
||||
Err(err) => Err(*err.downcast().unwrap()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for Error {
|
||||
|
||||
Reference in New Issue
Block a user