diff options
| author | sam-anthony <samanthony6@protonmail.com> | 2022-01-26 06:37:29 -0330 |
|---|---|---|
| committer | sam-anthony <samanthony6@protonmail.com> | 2022-01-26 06:37:29 -0330 |
| commit | b45ddda0fda44ffb5e4ffbfe94b4d293b06d883e (patch) | |
| tree | b0167611d285da4302b575ae35f93ee4902eb3dd /src/volume.rs | |
| parent | eb55242f08fcd4a9a3fdcc8de1110999614c8813 (diff) | |
| download | volute-b45ddda0fda44ffb5e4ffbfe94b4d293b06d883e.zip | |
basic input handling
Diffstat (limited to 'src/volume.rs')
| -rw-r--r-- | src/volume.rs | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/volume.rs b/src/volume.rs deleted file mode 100644 index d6ef206..0000000 --- a/src/volume.rs +++ /dev/null @@ -1,23 +0,0 @@ -pub struct Volume(f64); // Base unit is cubic metres - -impl Volume { - pub fn from_cubic_metres(cubic_metres: f64) -> Volume { - Volume(cubic_metres) - } - - pub fn from_cubic_centimetres(cubic_centimetres: f64) -> Volume { - Volume(cubic_centimetres / 1_000_000.) - } - - pub fn as_cubic_metres(&self) -> f64 { - self.0 - } - - pub fn as_cubic_centimetres(&self) -> f64 { - self.0 * 1_000_000. - } - - pub fn as_cubic_feet(&self) -> f64 { - self.0 * 35.3147 - } -} |