Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
trivially_copy_pass_by_ref
to the lint set. (#73)
This is an old standard lint from the Druid days, still enabled for [Druid](https://github.com/linebender/druid/blob/b831b5fe1597d5ec1fc3379cc1b39f3dd106e220/druid/src/lib.rs#L135), [Piet](https://github.com/linebender/piet/blob/aef3254b39c8aa291e3fb2d53fd941acd2f04be9/piet/src/lib.rs#L28), [Kurbo](https://github.com/linebender/kurbo/blob/1313f16b29fbbc84fc29fa4924c5dc9560460e83/src/lib.rs#L70), [Xilem](https://github.com/linebender/xilem/blob/10dc9d171ce08bf207ec3057b47d1405606faf58/xilem/src/lib.rs#L5), and was just [removed from Parley two days ago](linebender/parley#180) which triggered this PR. I think it makes sense to keep it as part of the standard set. It helps detect potential micro-optimizations. The default Clippy configuration option [`avoid-breaking-exported-api` is `true`](https://doc.rust-lang.org/clippy/lint_configuration.html#avoid-breaking-exported-api) which means it won't affect the public API. The main downside is that if we have a tiny struct which gets suggested for copy and then later that struct grows larger, we will need to manually update the methods to take a reference instead. Probably a good idea to add a code comment for potential growers about this. The `trivial-copy-size-limit` configuration of 16 bytes is also a continuation of an old decision. The rationale for optimizing for 64-bit is even more true today with even low-end mobile phones having 64-bit CPUs. I also bumped the linebender lint set version, but only for the `Cargo.toml` bunch. I think it can only cause wasted effort to bump the version in other files that have zero changes.
- Loading branch information