mirror of
https://github.com/actix/actix-web.git
synced 2024-12-24 09:00:34 +00:00
relax InternalError constraints
This commit is contained in:
parent
f55ff24925
commit
7bb7adf89c
2 changed files with 7 additions and 8 deletions
|
@ -116,8 +116,7 @@ specific error response. We can use helper types for first example with custom e
|
|||
#[macro_use] extern crate failure;
|
||||
use actix_web::*;
|
||||
|
||||
#[derive(Fail, Debug)]
|
||||
#[fail(display="Error {}", name)]
|
||||
#[derive(Debug)]
|
||||
struct MyError {
|
||||
name: &'static str
|
||||
}
|
||||
|
|
12
src/error.rs
12
src/error.rs
|
@ -531,7 +531,7 @@ impl<T> InternalError<T> {
|
|||
}
|
||||
|
||||
impl<T> Fail for InternalError<T>
|
||||
where T: Send + Sync + fmt::Display + fmt::Debug + 'static
|
||||
where T: Send + Sync + fmt::Debug + 'static
|
||||
{
|
||||
fn backtrace(&self) -> Option<&Backtrace> {
|
||||
Some(&self.backtrace)
|
||||
|
@ -539,7 +539,7 @@ impl<T> Fail for InternalError<T>
|
|||
}
|
||||
|
||||
impl<T> fmt::Debug for InternalError<T>
|
||||
where T: Send + Sync + fmt::Display + fmt::Debug + 'static
|
||||
where T: Send + Sync + fmt::Debug + 'static
|
||||
{
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fmt::Debug::fmt(&self.cause, f)
|
||||
|
@ -547,15 +547,15 @@ impl<T> fmt::Debug for InternalError<T>
|
|||
}
|
||||
|
||||
impl<T> fmt::Display for InternalError<T>
|
||||
where T: Send + Sync + fmt::Display + fmt::Debug + 'static
|
||||
where T: Send + Sync + fmt::Debug + 'static
|
||||
{
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fmt::Display::fmt(&self.cause, f)
|
||||
fmt::Debug::fmt(&self.cause, f)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> ResponseError for InternalError<T>
|
||||
where T: Send + Sync + fmt::Display + fmt::Debug + 'static
|
||||
where T: Send + Sync + fmt::Debug + 'static
|
||||
{
|
||||
fn error_response(&self) -> HttpResponse {
|
||||
HttpResponse::new(self.status, Body::Empty)
|
||||
|
@ -563,7 +563,7 @@ impl<T> ResponseError for InternalError<T>
|
|||
}
|
||||
|
||||
impl<T> Responder for InternalError<T>
|
||||
where T: Send + Sync + fmt::Display + fmt::Debug + 'static
|
||||
where T: Send + Sync + fmt::Debug + 'static
|
||||
{
|
||||
type Item = HttpResponse;
|
||||
type Error = Error;
|
||||
|
|
Loading…
Reference in a new issue