remove actix-util as dep

This commit is contained in:
fakeshadow 2021-10-18 08:56:37 +08:00
parent e2ac85a0b4
commit 159428a109
3 changed files with 7 additions and 7 deletions

View File

@ -21,7 +21,6 @@ io-uring = ["actix-web/io-uring", "tokio-uring"]
actix-web = { version = "4.0.0-beta.9", default-features = false }
actix-http = "3.0.0-beta.10"
actix-service = "2.0.0"
actix-utils = "3.0.0"
askama_escape = "0.10"
bitflags = "1"

View File

@ -8,7 +8,6 @@ use std::{
};
use actix_service::{Service, ServiceFactory};
use actix_utils::future::{ok, Ready};
use actix_web::dev::{AppService, HttpServiceFactory, ResourceDef};
use futures_core::future::LocalBoxFuture;
@ -604,14 +603,16 @@ impl ServiceFactory<ServiceRequest> for NamedFile {
type Response = ServiceResponse;
type Error = Error;
type Config = ();
type InitError = ();
type Service = NamedFileService;
type Future = Ready<Result<Self::Service, ()>>;
type InitError = ();
type Future = LocalBoxFuture<'static, Result<Self::Service, Self::InitError>>;
fn new_service(&self, _: ()) -> Self::Future {
ok(NamedFileService {
let service = NamedFileService {
path: self.path.clone(),
})
};
Box::pin(async move { Ok(service) })
}
}

View File

@ -1,9 +1,9 @@
use std::{
future::{ready, Ready},
path::{Path, PathBuf},
str::FromStr,
};
use actix_utils::future::{ready, Ready};
use actix_web::{dev::Payload, FromRequest, HttpRequest};
use crate::error::UriSegmentError;