http-error 0.3.0-alpha.1

Error trait to help convert errors to http error responses
Documentation
use std::fmt;

use crate::HttpError;

pub struct Reason<E>(pub E);

impl<E> fmt::Display for Reason<E>
where
    E: HttpError,
{
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        self.0.reason(f)
    }
}

impl fmt::Display for Reason<Box<dyn HttpError>> {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        self.0.reason(f)
    }
}

impl fmt::Display for Reason<Box<dyn HttpError + Send + 'static>> {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        self.0.reason(f)
    }
}