pub fn to_csv<T: Serialize + Clone>( item: &mut [T], path: PathBuf, ) -> Result<(), AddressErrorKind>
Generic function to serialize data types into a CSV file. Called by methods to avoid code duplication.