refactor: resultify location::set()

This commit is contained in:
link2xt
2023-09-27 17:00:39 +00:00
parent 88bba83383
commit 815c1b9c49
3 changed files with 32 additions and 31 deletions

View File

@@ -2567,7 +2567,12 @@ pub unsafe extern "C" fn dc_set_location(
}
let ctx = &*context;
block_on(location::set(ctx, latitude, longitude, accuracy)) as _
block_on(async move {
location::set(ctx, latitude, longitude, accuracy)
.await
.log_err(ctx)
.unwrap_or_default()
}) as libc::c_int
}
#[no_mangle]