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

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

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

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