Loading crates/s3s-fs/src/error.rs +6 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,12 @@ impl Error { log(&*source); Self { source } } #[must_use] #[track_caller] pub fn from_string(s: impl Into<String>) -> Self { Self::new(s.into().into()) } } impl<E> From<E> for Error Loading crates/s3s-fs/src/main.rs +18 −3 Original line number Diff line number Diff line Loading @@ -55,11 +55,26 @@ fn setup_tracing() { .init(); } #[tokio::main] async fn main() -> Result { setup_tracing(); fn check_cli_args(opt: &Opt) -> Result<(), String> { if let Some(ref s) = opt.domain_name { if s.contains('/') { return Err(format!("expected domain name, found URL-like string: {s:?}")); } } Ok(()) } fn main() -> Result { let opt = Opt::parse(); check_cli_args(&opt).map_err(s3s_fs::Error::from_string)?; setup_tracing(); run(opt) } #[tokio::main] async fn run(opt: Opt) -> Result { // Setup S3 provider let fs = FileSystem::new(opt.root)?; Loading Loading
crates/s3s-fs/src/error.rs +6 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,12 @@ impl Error { log(&*source); Self { source } } #[must_use] #[track_caller] pub fn from_string(s: impl Into<String>) -> Self { Self::new(s.into().into()) } } impl<E> From<E> for Error Loading
crates/s3s-fs/src/main.rs +18 −3 Original line number Diff line number Diff line Loading @@ -55,11 +55,26 @@ fn setup_tracing() { .init(); } #[tokio::main] async fn main() -> Result { setup_tracing(); fn check_cli_args(opt: &Opt) -> Result<(), String> { if let Some(ref s) = opt.domain_name { if s.contains('/') { return Err(format!("expected domain name, found URL-like string: {s:?}")); } } Ok(()) } fn main() -> Result { let opt = Opt::parse(); check_cli_args(&opt).map_err(s3s_fs::Error::from_string)?; setup_tracing(); run(opt) } #[tokio::main] async fn run(opt: Opt) -> Result { // Setup S3 provider let fs = FileSystem::new(opt.root)?; Loading