Closed
Description
What it does
Lint any integer or floating point constants that have their type determined by the default fallback rather than inference
Categories (optional)
- Kind: pedantic
What is the advantage of the recommended code over the original code
Avoids unintended use of the numeric default types, forcing the author to think about what type is appropriate.
Drawbacks
Forcing the author to think about what type is appropriate.
Example
let (x, y) = (5, 6.0);
Could be written as:
let (x, y): (i32, f32) = (5, 6.0);
let (x, y) = (5i32, 6.0f32);