From b45ddda0fda44ffb5e4ffbfe94b4d293b06d883e Mon Sep 17 00:00:00 2001 From: sam-anthony Date: Wed, 26 Jan 2022 06:37:29 -0330 Subject: basic input handling --- src/lib.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 79dda37..8fd6b17 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,14 +1,10 @@ -pub mod flow_rate; -pub mod mass; -pub mod pressure; -pub mod temperature; -pub mod volume; +pub mod unit_of_measurement; -use crate::{pressure::Pressure, temperature::Temperature, volume::Volume}; +use crate::unit_of_measurement::{Pressure, Temperature, Volume}; const GAS_CONSTANT: f64 = 8.314472; const MOLAR_MASS_OF_AIR: f64 = 0.0289647; // Kg/mol -fn moles_from_gas_law(pressure: Pressure, volume: Volume, temperature: Temperature) -> f64 { - (pressure.as_pascals() * volume.as_cubic_metres()) / (GAS_CONSTANT * temperature.as_kelvin()) +fn moles_from_gas_law(pres: Pressure, vol: Volume, temp: Temperature) -> f64 { + (pres.as_pascals() * vol.as_cubic_metres()) / (GAS_CONSTANT * temp.as_kelvin()) } -- cgit v1.2.3