rename array to list in rust types

This commit is contained in:
Dustin J. Mitchell
2022-02-12 15:20:46 +00:00
parent e9cd6adc5b
commit f81c4eec90
6 changed files with 37 additions and 37 deletions

View File

@@ -154,7 +154,7 @@ pub struct TCStringList {
items: *const NonNull<TCString<'static>>,
}
impl CArray for TCStringList {
impl CList for TCStringList {
type Element = NonNull<TCString<'static>>;
unsafe fn from_raw_parts(items: *const Self::Element, len: usize, cap: usize) -> Self {
@@ -325,7 +325,7 @@ pub unsafe extern "C" fn tc_string_list_free(tcstrings: *mut TCStringList) {
// - tcstrings is not NULL and points to a valid TCStringList (caller is not allowed to
// modify the list)
// - caller promises not to use the value after return
unsafe { drop_pointer_array(tcstrings) };
unsafe { drop_pointer_list(tcstrings) };
}
#[cfg(test)]
@@ -334,7 +334,7 @@ mod test {
use pretty_assertions::assert_eq;
#[test]
fn empty_array_has_non_null_pointer() {
fn empty_list_has_non_null_pointer() {
let tcstrings = TCStringList::return_val(Vec::new());
assert!(!tcstrings.items.is_null());
assert_eq!(tcstrings.len, 0);