Answers for "rust•armanazi•error•[E0308]: mismatched types expected integer, found floating-point number"

0

rust•armanazi•error•[E0308]: mismatched types expected integer, found floating-point number

//Resolved by adding U
struct Point<T, U> {
    x: T,
    y: U,
}

fn main() {
    let both_integer = Point { x: 5, y: 10 };
    let both_float = Point { x: 1.0, y: 4.0 };
    let integer_and_float = Point { x: 5, y: 4.0 };
}
Posted by: Guest on March-18-2022

Code answers related to "rust•armanazi•error•[E0308]: mismatched types expected integer, found floating-point number"

Browse Popular Code Answers by Language