TCTags as PassByValue

This commit is contained in:
Dustin J. Mitchell
2022-02-06 05:04:44 +00:00
parent 23ba6a57b3
commit f4c6e04d44
7 changed files with 227 additions and 91 deletions

View File

@@ -142,7 +142,8 @@ pub extern "C" fn tc_replica_get_task(rep: *mut TCReplica, tcuuid: TCUuid) -> *m
wrap(
rep,
|rep| {
let uuid = Uuid::from_arg(tcuuid);
// SAFETY: see TCUuid docstring
let uuid = unsafe { Uuid::from_arg(tcuuid) };
if let Some(task) = rep.get_task(uuid)? {
Ok(TCTask::from(task).return_val())
} else {
@@ -185,7 +186,8 @@ pub extern "C" fn tc_replica_import_task_with_uuid(
wrap(
rep,
|rep| {
let uuid = Uuid::from_arg(tcuuid);
// SAFETY: see TCUuid docstring
let uuid = unsafe { Uuid::from_arg(tcuuid) };
let task = rep.import_task_with_uuid(uuid)?;
Ok(TCTask::from(task).return_val())
},