diff options
| author | sam-anthony <samanthony6@protonmail.com> | 2022-01-15 20:31:04 -0330 |
|---|---|---|
| committer | sam-anthony <samanthony6@protonmail.com> | 2022-01-15 20:31:04 -0330 |
| commit | ef3980225a0a0ed5bea0d748709c1f227e33c851 (patch) | |
| tree | eafe6e82c02224ea62b5c7acdf75ae2fd93f2187 /src/temperature.rs | |
| download | volute-ef3980225a0a0ed5bea0d748709c1f227e33c851.zip | |
units of measurement
Diffstat (limited to 'src/temperature.rs')
| -rw-r--r-- | src/temperature.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/temperature.rs b/src/temperature.rs new file mode 100644 index 0000000..2eac48d --- /dev/null +++ b/src/temperature.rs @@ -0,0 +1,11 @@ +pub struct Temperature(f64); // Base unit is kelvin + +impl Temperature { + pub fn from_kelvin(kelvin: f64) -> Temperature { + Temperature(kelvin) + } + + pub fn as_kelvin(&self) -> f64 { + self.0 + } +} |