1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
use crate::chunked_array::object::extension::drop::drop_list;
use crate::prelude::*;

impl<T> Drop for ChunkedArray<T> {
    fn drop(&mut self) {
        if matches!(self.dtype(), DataType::List(_)) {
            // guarded by the type system
            unsafe { drop_list(std::mem::transmute(self)) }
        }
    }
}