remove option<path> from inner/imex handling to simplify the code

This commit is contained in:
holger krekel
2020-10-26 15:06:32 +01:00
parent 45ea41262c
commit 622d99a971
4 changed files with 25 additions and 37 deletions

View File

@@ -1727,13 +1727,15 @@ pub unsafe extern "C" fn dc_imex(
let ctx = &*context;
let param1 = to_opt_string_lossy(param1);
spawn(async move {
imex::imex(&ctx, what, param1)
.await
.log_err(ctx, "IMEX failed")
});
if let Some(param1) = to_opt_string_lossy(param1) {
spawn(async move {
imex::imex(&ctx, what, &param1)
.await
.log_err(ctx, "IMEX failed")
});
} else {
eprintln!("dc_imex called without a valid directory");
}
}
#[no_mangle]