Skip to main content

oxiphysics_io/csv_io/
lazycsviter_traits.rs

1//! # LazyCsvIter - Trait Implementations
2//!
3//! This module contains trait implementations for `LazyCsvIter`.
4//!
5//! ## Implemented Traits
6//!
7//! - `Iterator`
8//!
9//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
10
11#[allow(unused_imports)]
12use super::functions::*;
13use super::types::LazyCsvIter;
14
15impl<'a> Iterator for LazyCsvIter<'a> {
16    type Item = Vec<String>;
17    fn next(&mut self) -> Option<Self::Item> {
18        let line = self.lines.next()?;
19        Some(
20            line.split(self.delimiter)
21                .map(str::trim)
22                .map(String::from)
23                .collect(),
24        )
25    }
26}