I have the following code:
struct Stuff {
thing: i8
}
fn main(){
let theStuff = Stuff { thing: 1 };
println!("{}", theStuff.thing * 1.5);
}
I get the following on compilation:
error[E0277]: the trait bound `i8: std::ops::Mul<{float}>` is not satisfied
--> IntFloatMultiply.rs:7:32
|
7 | println!("{}", theStuff.thing * 1.5);
| ^ no implementation for `i8 * {float}`
|
= help: the trait `std::ops::Mul<{float}>` is not implemented for `i8`
I've read some other posts including a bunch of stuff that is pretty well over my head (including https://stackoverflow.com/a/44552464/1678392). I don't care about the technical details, what or why, if I don't have a concrete answer to start from. How do I get this code to compile so it displays a float result?