dylint

unnamed_constant

What it does

Checks for unnamed constants, aka magic numbers.

Why is this bad?

“Magic numbers are considered bad practice in programming, because they can make the code more difficult to understand and harder to maintain.” (pandaquests)

Example

x *= 1000;

Use instead:

const MILLIS: u64 = 1000;
x *= MILLIS;

Configuration