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

@@ -62,7 +62,7 @@ pub struct TCAnnotationList {
items: *const TCAnnotation,
}
impl CArray for TCAnnotationList {
impl CList for TCAnnotationList {
type Element = TCAnnotation;
unsafe fn from_raw_parts(items: *const Self::Element, len: usize, cap: usize) -> Self {
@@ -99,7 +99,7 @@ pub unsafe extern "C" fn tc_annotation_list_free(tcanns: *mut TCAnnotationList)
// - tcanns is not NULL and points to a valid TCAnnotationList (caller is not allowed to
// modify the list)
// - caller promises not to use the value after return
unsafe { drop_value_array(tcanns) }
unsafe { drop_value_list(tcanns) }
}
#[cfg(test)]
@@ -107,7 +107,7 @@ mod test {
use super::*;
#[test]
fn empty_array_has_non_null_pointer() {
fn empty_list_has_non_null_pointer() {
let tcanns = TCAnnotationList::return_val(Vec::new());
assert!(!tcanns.items.is_null());
assert_eq!(tcanns.len, 0);