diff --git a/actix-files/Cargo.toml b/actix-files/Cargo.toml index 13c697809..456314bdf 100644 --- a/actix-files/Cargo.toml +++ b/actix-files/Cargo.toml @@ -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" diff --git a/actix-files/src/named.rs b/actix-files/src/named.rs index 06b32bb30..bff585761 100644 --- a/actix-files/src/named.rs +++ b/actix-files/src/named.rs @@ -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 for NamedFile { type Response = ServiceResponse; type Error = Error; type Config = (); - type InitError = (); type Service = NamedFileService; - type Future = Ready>; + type InitError = (); + type Future = LocalBoxFuture<'static, Result>; fn new_service(&self, _: ()) -> Self::Future { - ok(NamedFileService { + let service = NamedFileService { path: self.path.clone(), - }) + }; + + Box::pin(async move { Ok(service) }) } } diff --git a/actix-files/src/path_buf.rs b/actix-files/src/path_buf.rs index 76f589307..b3000cda0 100644 --- a/actix-files/src/path_buf.rs +++ b/actix-files/src/path_buf.rs @@ -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;