error type-mismatch
Тип выражения не соответствует ожидаемому.
What it means#
The type of an expression is not a subtype of the type the context expects (§3). The only implicit conversions are widening of a value to a union that contains its type (A to A | B, T to T?) and, for refined types, to the base type (§3.6). Numbers, distinct types and strings are never converted silently.
Example#
fn main() {
let count: i32 = "five" // <- type-mismatch
}error
type-mismatch
How to fix#
fn main() {
let count: i32 = 5
}Change the expression or the annotation so that the types agree. Use an explicit conversion where one exists: x as T for numbers, Port.from(x) for refined types.