aboutsummaryrefslogtreecommitdiffstats
path: root/src/config.rs
diff options
context:
space:
mode:
authorAlec Di Vito <me@alecdivito.com>2025-03-02 19:46:10 +0000
committerAlec Di Vito <me@alecdivito.com>2025-03-02 19:46:10 +0000
commit33c79837f1e113a1ce83a461413acf474e973c63 (patch)
treef1745dccd93f05fbb8a9920233ddef33bfe8963f /src/config.rs
parentfeat: address comments; add in new argument (`temp-directory`); add comments ... (diff)
downloadminiserve-33c79837f1e113a1ce83a461413acf474e973c63.tar.gz
miniserve-33c79837f1e113a1ce83a461413acf474e973c63.zip
feat: validate temp dir exists through `value_parser` and fixed clippy issues
Diffstat (limited to '')
-rw-r--r--src/config.rs8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/config.rs b/src/config.rs
index 6a048c2..4404959 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -278,16 +278,10 @@ impl MiniserveConfig {
.transpose()?
.unwrap_or_default();
- let temp_upload_directory = args.temp_upload_directory.as_ref().take().map(|v| if v.exists() && v.is_dir() {
- Ok(v.clone())
- } else {
- Err(anyhow!("Upload temporary directory must exist and be a directory. Validate that path {v:?} meets those requirements"))
- }).transpose()?;
-
Ok(Self {
verbose: args.verbose,
path: args.path.unwrap_or_else(|| PathBuf::from(".")),
- temp_upload_directory,
+ temp_upload_directory: args.temp_upload_directory,
port,
interfaces,
auth,