diff --git a/src/asynchronous/compact.rs b/src/asynchronous/compact.rs index 6142c8e..28f11af 100644 --- a/src/asynchronous/compact.rs +++ b/src/asynchronous/compact.rs @@ -21,7 +21,7 @@ pub async fn compact( ) -> Result<(), CompactError> { let local_path = common_options.local_path.as_ref().map_or("borg", |x| x); - let args = compact_fmt_args(options, common_options).map_err(|_| CompactError::ShlexError)?; + let args = compact_fmt_args(options, common_options); debug!("Calling borg: {local_path} {args}"); let args = shlex::split(&args).ok_or(CompactError::ShlexError)?; let res = tokio::process::Command::new(local_path) diff --git a/src/asynchronous/create.rs b/src/asynchronous/create.rs index 36e01ee..2f189b5 100644 --- a/src/asynchronous/create.rs +++ b/src/asynchronous/create.rs @@ -25,8 +25,7 @@ pub async fn create( ) -> Result { let local_path = common_options.local_path.as_ref().map_or("borg", |x| x); - let args = - create_fmt_args(options, common_options, false).map_err(|_| CreateError::ShlexError)?; + let args = create_fmt_args(options, common_options, false); debug!("Calling borg: {local_path} {args}"); let args = shlex::split(&args).ok_or(CreateError::ShlexError)?; let res = execute_borg(local_path, args, &options.passphrase).await?; @@ -97,8 +96,7 @@ pub async fn create_progress( ) -> Result { let local_path = common_options.local_path.as_ref().map_or("borg", |x| x); - let args = - create_fmt_args(options, common_options, true).map_err(|_| CreateError::ShlexError)?; + let args = create_fmt_args(options, common_options, true); debug!("Calling borg: {local_path} {args}"); let args = shlex::split(&args).ok_or(CreateError::ShlexError)?; let mut child = if let Some(passphrase) = &options.passphrase { diff --git a/src/asynchronous/init.rs b/src/asynchronous/init.rs index 66ede14..b2a228a 100644 --- a/src/asynchronous/init.rs +++ b/src/asynchronous/init.rs @@ -12,7 +12,7 @@ use crate::errors::InitError; pub async fn init(options: &InitOptions, common_options: &CommonOptions) -> Result<(), InitError> { let local_path = common_options.local_path.as_ref().map_or("borg", |x| x); - let args = init_fmt_args(options, common_options).map_err(|_| InitError::ShlexError)?; + let args = init_fmt_args(options, common_options); let passphrase = options.encryption_mode.get_passphrase(); debug!("Calling borg: {local_path} {args}"); diff --git a/src/asynchronous/list.rs b/src/asynchronous/list.rs index acd46bf..b0bef4a 100644 --- a/src/asynchronous/list.rs +++ b/src/asynchronous/list.rs @@ -16,7 +16,7 @@ pub async fn list( ) -> Result { let local_path = common_options.local_path.as_ref().map_or("borg", |x| x); - let args = list_fmt_args(options, common_options).map_err(|_| ListError::ShlexError)?; + let args = list_fmt_args(options, common_options); debug!("Calling borg: {local_path} {args}"); let args = shlex::split(&args).ok_or(ListError::ShlexError)?; let res = execute_borg(local_path, args, &options.passphrase).await?; diff --git a/src/asynchronous/mount.rs b/src/asynchronous/mount.rs index 8c3d0d0..5e8463f 100644 --- a/src/asynchronous/mount.rs +++ b/src/asynchronous/mount.rs @@ -15,7 +15,7 @@ pub async fn mount( ) -> Result<(), MountError> { let local_path = common_options.local_path.as_ref().map_or("borg", |x| x); - let args = mount_fmt_args(options, common_options).map_err(|_| MountError::ShlexError)?; + let args = mount_fmt_args(options, common_options); debug!("Calling borg: {local_path} {args}"); let args = shlex::split(&args).ok_or(MountError::ShlexError)?; let res = execute_borg(local_path, args, &options.passphrase).await?; diff --git a/src/asynchronous/prune.rs b/src/asynchronous/prune.rs index bfb1022..23f5484 100644 --- a/src/asynchronous/prune.rs +++ b/src/asynchronous/prune.rs @@ -15,7 +15,7 @@ pub async fn prune( ) -> Result<(), PruneError> { let local_path = common_options.local_path.as_ref().map_or("borg", |x| x); - let args = prune_fmt_args(options, common_options).map_err(|_| PruneError::ShlexError)?; + let args = prune_fmt_args(options, common_options); debug!("Calling borg: {local_path} {args}"); let args = shlex::split(&args).ok_or(PruneError::ShlexError)?; let res = execute_borg(local_path, args, &options.passphrase).await?;