1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-20 12:45:41 +02:00

use Error explicitly

This commit is contained in:
Nikolay Kim
2019-04-25 11:14:32 -07:00
parent cba78e06ae
commit 70a4c36496
8 changed files with 43 additions and 44 deletions

View File

@@ -5,6 +5,7 @@ use futures::future::{self, FutureResult};
use regex::Regex;
use crate::service::{ServiceRequest, ServiceResponse};
use crate::Error;
#[derive(Default, Clone, Copy)]
/// `Middleware` to normalize request's URI in place
@@ -16,11 +17,11 @@ pub struct NormalizePath;
impl<S> Transform<S> for NormalizePath
where
S: Service<Request = ServiceRequest, Response = ServiceResponse>,
S: Service<Request = ServiceRequest, Response = ServiceResponse, Error = Error>,
{
type Request = ServiceRequest;
type Response = ServiceResponse;
type Error = S::Error;
type Error = Error;
type InitError = ();
type Transform = NormalizePathNormalization<S>;
type Future = FutureResult<Self::Transform, Self::InitError>;
@@ -40,11 +41,11 @@ pub struct NormalizePathNormalization<S> {
impl<S> Service for NormalizePathNormalization<S>
where
S: Service<Request = ServiceRequest, Response = ServiceResponse>,
S: Service<Request = ServiceRequest, Response = ServiceResponse, Error = Error>,
{
type Request = ServiceRequest;
type Response = ServiceResponse;
type Error = S::Error;
type Error = Error;
type Future = S::Future;
fn poll_ready(&mut self) -> futures::Poll<(), Self::Error> {