From e698b2ff65fa984c256219b2c9d6ba9d19b37122 Mon Sep 17 00:00:00 2001 From: afterlifepro Date: Fri, 26 Sep 2025 17:57:56 +0100 Subject: [PATCH] upload: use strings in config --- upload/src/config.rs | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/upload/src/config.rs b/upload/src/config.rs index c411d3e..f113a9f 100644 --- a/upload/src/config.rs +++ b/upload/src/config.rs @@ -1,12 +1,7 @@ -pub enum Id { - Handle(String), - Did(String), -} - pub struct Config { - pub user: Id, + pub user: String, pub pword: String, - pub dir: std::path::PathBuf, + pub dir: String, } pub enum ConfigErr { @@ -44,19 +39,6 @@ pub fn extract() -> Result { && let Some(pword) = pword.clone() && let Some(dir) = dir.clone() { - // we do not validate that the did or handle is valid rn - // but if it contains a : then its definitely a did - let user = if user.contains(":") { - Id::Did(user) - } else { - Id::Handle(user) - }; - - let dir = std::path::Path::new(&dir); - if !dir.is_dir() { - return Err(ConfigErr::NotADirectory); - }; - return Ok(Config { user, pword, -- 2.51.2