Simplify implementation of arrays

This commit is contained in:
Dustin J. Mitchell
2022-02-07 00:15:09 +00:00
parent e11506ee6a
commit a270b6c254
5 changed files with 130 additions and 54 deletions

View File

@@ -321,7 +321,7 @@ pub extern "C" fn tc_task_has_tag<'a>(task: *mut TCTask, tag: *mut TCString) ->
#[no_mangle]
pub extern "C" fn tc_task_get_tags<'a>(task: *mut TCTask) -> TCStrings {
wrap(task, |task| {
let tcstrings: Vec<NonNull<TCString<'static>>> = task
let vec: Vec<NonNull<TCString<'static>>> = task
.get_tags()
.map(|t| {
NonNull::new(
@@ -331,7 +331,7 @@ pub extern "C" fn tc_task_get_tags<'a>(task: *mut TCTask) -> TCStrings {
.expect("TCString::return_val() returned NULL")
})
.collect();
TCStrings::return_val(tcstrings)
TCStrings::return_val(vec)
})
}