1
2
3
4
5
6
7
8
9
10
11
use crate::{FromRow, IntoTypedError, Row};

pub trait IntoTypedRows {
    fn into_typed<T: FromRow>(self) -> Result<Vec<T>, IntoTypedError>;
}

impl IntoTypedRows for Vec<Row> {
    fn into_typed<T: FromRow>(self) -> Result<Vec<T>, IntoTypedError> {
        self.into_iter().map(T::from_row).collect()
    }
}