1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
pub mod conversions { pub mod temperature { pub fn c_to_f(c:f64) -> f64 { let f = c*(9.0/5.0) + 32.0; f } pub fn f_to_c(f: f64) -> f64 { let c = (f-32.0)/1.8; c } } }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
pub mod conversions { pub mod temperature { pub fn c_to_f(c:f64) -> f64 { let f = c*(9.0/5.0) + 32.0; f } pub fn f_to_c(f: f64) -> f64 { let c = (f-32.0)/1.8; c } } }