1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//! Contains the implementation of [`PlantsSummaryDto`].

use crate::model::entity::Plants;

use super::PlantsSummaryDto;

impl From<Plants> for PlantsSummaryDto {
    fn from(plants: Plants) -> Self {
        Self {
            id: plants.id,
            unique_name: plants.unique_name,
            common_name_en: plants.common_name_en,
            common_name_de: plants.common_name_de,
            spread: plants.spread,
        }
    }
}

impl<T> From<(T, Plants)> for PlantsSummaryDto {
    fn from((_, plants): (T, Plants)) -> Self {
        Self::from(plants)
    }
}