Add Error::into_inner (#1476)

This commit is contained in:
Jonas Platte 2022-10-13 11:44:54 +02:00 committed by GitHub
parent 199a7a66b8
commit b378fb283f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -8,8 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
# Unreleased
- **added:** Add `DefaultBodyLimit::max` for changing the default body limit ([#1397])
- **added:** Add `Error::into_inner` for converting `Error` to `BoxError` without allocating ([#1476])
[#1397]: https://github.com/tokio-rs/axum/pull/1397
[#1476]: https://github.com/tokio-rs/axum/pull/1476
# 0.3.0-rc.2 (10. September, 2022)

View File

@ -14,6 +14,11 @@ impl Error {
inner: error.into(),
}
}
/// Convert an `Error` back into the underlying boxed trait object.
pub fn into_inner(self) -> BoxError {
self.inner
}
}
impl fmt::Display for Error {