4 ms·
Clippy would only complain about expensive expressions when it can prove that the alternative would be always better than the original (for example, `or_fun_cal
by lifthrasiir 3y ago
Clippy would only complain about expensive expressions when it can prove that the alternative would be always better than the original (for example, `or_fun_call` [1]). It is not impossible to measure the cost of given expression to suggest that, but that would increase a risk of false positives. The OP has the same challenge---this kind of range analysis can only occur (and currently does occur) much later than Clippy.
[1] https://rust-lang.github.io/rust-clippy/master/index.html#/or_fun_call https://rust-lang.github.io/rust-clippy/master/index.html#/o...