rust-clippy
rust-clippy copied to clipboard
Optimise Msrv for common one item case
Currently, Msrv is cloned around a lot in order to handle the #[clippy::msrv] attribute. This attribute, however, means RustcVersion will be heap allocated if there is only one source of an msrv (eg: rust-version in Cargo.toml).
This PR optimizes for said case, while keeping the external interface the same by:
- Storing
RustVersioninline for the common one element case. - Swapping to
ThinVecto shrinkMsrvto 16 bytes, from 24, to optimize for the zero and one element cases.
changelog: none