Why this fires¶
as only performs compiler-known casts. It does not parse text, compute
truthiness, serialize data, or run a conversion implemented by a user type.
let port = "8080" as u16 // error[TE835]Fix it¶
Choose the operation that matches the intent:
let port = "8080".parse::<u16>()?
let text = value.to_string()
let user = raw.try_into::<User>()?Use an explicit comparison instead of casting a value to bool.