14 lines
342 B
Rust
14 lines
342 B
Rust
use crate::domain::ingredient::types;
|
|
|
|
pub trait IngredientRepo {
|
|
fn get_ingredients(&self) -> Vec<types::Ingredient>;
|
|
}
|
|
|
|
pub struct StaticIngredientRepo {}
|
|
|
|
impl IngredientRepo for StaticIngredientRepo {
|
|
fn get_ingredients(&self) -> Vec<types::Ingredient> {
|
|
db::INGREDIENTS.iter().map(From::from).collect::<Vec<_>>()
|
|
}
|
|
}
|