Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extern crate failure;
- fn get_temp() -> ::std::result::Result<f64, ::failure::Error> {
- //let valid_temps: Vec<f64> = vec![50.0, 45.1, 32.9, 45.1, 43.3, 46.56, 43.6, 23.3];
- let valid_temps: Vec<f64> = Vec::with_capacity(8);
- return valid_temps.iter().sum::<f64>() / valid_temps.len() as f64
- }
- fn main() {
- println!("temp: {}", get_temp());
- }
Add Comment
Please, Sign In to add comment