Add fat to nutrition.rs
This commit is contained in:
parent
1ad530127e
commit
48dfd7104c
@ -59,6 +59,7 @@ pub fn init_camera_feed(product_options_js: JsValue) -> Result<(), String> {
|
||||
divisor: 0,
|
||||
kJ: 0.,
|
||||
kcal: 0.,
|
||||
fat: 0.,
|
||||
saturated_fat: 0.,
|
||||
carbohydrate: 0.,
|
||||
sugar: 0.,
|
||||
|
@ -21,6 +21,7 @@ pub struct Nutrition {
|
||||
pub divisor: u32,
|
||||
pub kJ: f32,
|
||||
pub kcal: f32,
|
||||
pub fat: f32,
|
||||
pub saturated_fat: f32,
|
||||
pub carbohydrate: f32,
|
||||
pub sugar: f32,
|
||||
@ -55,6 +56,7 @@ type RowType = HList!(
|
||||
Option<f32>,
|
||||
Option<f32>,
|
||||
Option<f32>,
|
||||
Option<f32>,
|
||||
);
|
||||
|
||||
impl Nutrition {
|
||||
@ -81,6 +83,7 @@ impl Nutrition {
|
||||
divisor,
|
||||
k_j,
|
||||
kcal,
|
||||
fat,
|
||||
saturated_fat,
|
||||
carbohydrate,
|
||||
sugar,
|
||||
@ -102,6 +105,7 @@ impl Nutrition {
|
||||
divisor: divisor.unwrap_or(0),
|
||||
kJ: k_j.unwrap_or(0.),
|
||||
kcal: kcal.unwrap_or(0.),
|
||||
fat: fat.unwrap_or(0.),
|
||||
saturated_fat: saturated_fat.unwrap_or(0.),
|
||||
carbohydrate: carbohydrate.unwrap_or(0.),
|
||||
sugar: sugar.unwrap_or(0.),
|
||||
|
Loading…
Reference in New Issue
Block a user