From 3e578e839b4c8490d193df30bfe8001a39025884 Mon Sep 17 00:00:00 2001 From: fakeshadow <24548779@qq.com> Date: Thu, 14 Oct 2021 06:02:03 +0800 Subject: [PATCH] fix foreign File::open API --- actix-files/src/lib.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/actix-files/src/lib.rs b/actix-files/src/lib.rs index a8a747d12..da2d50c6d 100644 --- a/actix-files/src/lib.rs +++ b/actix-files/src/lib.rs @@ -214,7 +214,17 @@ mod tests { #[actix_rt::test] async fn test_named_file_non_ascii_file_name() { - let file = crate::named::File::open("Cargo.toml").await.unwrap(); + let file = { + #[cfg(feature = "io-uring")] + { + crate::named::File::open("Cargo.toml").await.unwrap() + } + + #[cfg(not(feature = "io-uring"))] + { + crate::named::File::open("Cargo.toml").unwrap() + } + }; let mut file = NamedFile::from_file(file, "貨物.toml").unwrap(); {