From 167068d070afb75ce47ec961904a1c4f2f666671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bardon?= Date: Sun, 25 Aug 2024 20:14:58 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=91=EF=B8=8F=20Fix=20stable=20builds?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/orangutan-server/src/main.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/orangutan-server/src/main.rs b/src/orangutan-server/src/main.rs index a5a7e93..8b3bbad 100644 --- a/src/orangutan-server/src/main.rs +++ b/src/orangutan-server/src/main.rs @@ -121,8 +121,8 @@ fn not_found() -> Result, Response> { })?; let file_path = website_dir.join(NOT_FOUND_FILE); - match fs::exists(&file_path) { - Ok(true) => { + match fs::metadata(&file_path) { + Ok(_) => { let res = tokio::task::block_in_place(move || { Handle::current().block_on(async move { ServeFile::new(file_path.clone()) @@ -134,13 +134,6 @@ fn not_found() -> Result, Response> { }); Ok(res) }, - Ok(false) => { - error(format!( - "Could not read \"not found\" file at <{}>: File doesn't exist.", - file_path.display(), - )); - Err(fallback()) - }, Err(err) => { error(format!( "Could not read \"not found\" file at <{}>: {err}",