From 6d9b3fcbc62f9bf6fd22ac93c340fefbda051258 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 4 Mar 2024 19:20:49 +0000 Subject: [PATCH] Correctly handle filesystem create errors --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 62bc74b2..c8dc5a39 100644 --- a/src/main.rs +++ b/src/main.rs @@ -71,13 +71,13 @@ fn setup(config_folder: &Path) -> IoResult<(Data>, ServerConfig, // Create necessary directories. fs::create_dir_all(&server_config.upload_path)?; for paste_type in &[PasteType::Url, PasteType::Oneshot, PasteType::OneshotUrl] { - let _ = paste_type + let upload_path = paste_type .get_path(&server_config.upload_path) .ok_or(IoError::new( IoErrorKind::Other, String::from("Invalid upload path"), - )) - .map(fs::create_dir_all)?; + ))?; + fs::create_dir_all(upload_path)?; } // Set up a watcher for the configuration file changes.