From c64b53dfd7383aa72381700d7b906ba16418119d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arma=C3=ABl=20Gu=C3=A9neau?= Date: Mon, 3 Feb 2025 14:39:17 +0100 Subject: [PATCH] STORAGE_BACKEND setting: use "local" if unspecified the implementation now matches what is the README specifies --- src/storage.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/storage.rs b/src/storage.rs index f6909c0..42dcb2b 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -27,19 +27,19 @@ impl Storage { } pub async fn from_env() -> anyhow::Result { - match env_var("STORAGE_BACKEND")?.as_ref() { - "local" => { + match env_var("STORAGE_BACKEND").as_deref() { + Ok("local") | Err(_) => { let dir = match env_var("STORAGE_LOCAL_DIR") { Ok(dir) => dir, Err(_) => ".".to_string(), }; Ok(Self::from_local_dir(PathBuf::from(dir))) } - "s3" => { + Ok("s3") => { let bucket = env_var("STORAGE_S3_BUCKET")?; Ok(Self::from_s3(bucket).await) } - other => { + Ok(other) => { anyhow::bail!("STORAGE_BACKEND: unexpected value {other} (expected: local/s3)") } }