I'm new in rust and stuck in the error below, and i could not find any clue on it. Anyone can point me out? I got no idea how to define the read_line in float.
.read_line(&mut fahrenheit)
| ^^^^^^^^^^^^^^^ expected struct String, found f64
fn main(){
println!("enter fahrenheit: ");
//io::stdin() .read_line(&mut index) .expect("Failed to read line");
let mut fahrenheit: f64 = 66.66;
io::stdin()
.read_line(&mut fahrenheit)
.expect("fail to read");
let tempConvert = fahrenheitToCelsius(fahrenheit);
println!("convert from {tempConvert}");
}
fn fahrenheitToCelsius(x: f64) -> f64{
let mut gt: f64;
gt = (x - 32.00) * 5.00 / 9.00;
gt
}