aboutsummaryrefslogtreecommitdiffstats
path: root/src/volume/litre.rs
blob: 2b4e7c2c955541decbb0903d9afa6b1ba4f4a1ea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use super::{CubicCentimetre, CubicMetre};

#[derive(Debug, PartialEq)]
pub struct Litre(pub f64);

impl From<CubicMetre> for Litre {
    fn from(value: CubicMetre) -> Self {
        Self(value.0 * 10_f64.powi(3))
    }
}

impl From<CubicCentimetre> for Litre {
    fn from(value: CubicCentimetre) -> Self {
        Self(value.0 * 10_f64.powi(-3))
    }
}