You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to implement size_hint() on Range, we need some numeric trait that covers the ability to convert a given type to uint (or more generally, Option<uint>, to cover out of bounds conversions).
More specifically, we need to convert the result of a - b where a and b are values of the numeric type. The definition for this conversion to uint would be the number of times that you'd have to add One::one() to the result to get a back (which is the obvious definition, really).
This is needed because range() doesn't restrict its inputs to primitive numeric types.
The text was updated successfully, but these errors were encountered:
Remove deps
This remove both `regex` and `cargo_metadata` as dependencies making `clippy_dev` compile ~3x faster (~46s -> ~16s locally). `cargo_metadata` was used to extract the `version` field from `Cargo.toml`, which is done trivially without that. `regex` was used to parse `define_clippy_lint` in `update_lints` which is now done using `rustc_lexer`. This isn't any simpler, but it compiles ~15s faster and runs ~3x faster (~2.1s -> ~0.7s locally).
The next biggest offenders to compile times are `clap` and `winapi` on windows. `clap` could be removed, but re-implementing enough is probably more work than it's worth. `winapi` is used by `opener` and `walkdir` so it's stuck there.
changelog: none
In order to implement
size_hint()
onRange
, we need some numeric trait that covers the ability to convert a given type touint
(or more generally,Option<uint>
, to cover out of bounds conversions).More specifically, we need to convert the result of
a - b
wherea
andb
are values of the numeric type. The definition for this conversion touint
would be the number of times that you'd have to addOne::one()
to the result to geta
back (which is the obvious definition, really).This is needed because
range()
doesn't restrict its inputs to primitive numeric types.The text was updated successfully, but these errors were encountered: