firecracker-microvm / firecracker-microvm/firecracker
Use `clippy::as_conversions`
- Dominant language
- Rust
- Stars
- 36.7k
- Forks
- 2.6k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 53
Description
From a discussion https://github.com/firecracker-microvm/firecracker/pull/3156#discussion_r986640407 it was thought utilizing the clippy lint [`clippy::as_conversions`](https://rust-lang.github.io/rust-clippy/master/#as_conversions) would introduce additional safety.
It would be good to implement this lint, either via `#![warn(clippy::as_conversions)]` or passed as a command line argument under `test_clippy.py`.
To break up this work, we can implement the following lints incrementally:
- [x] #3195
- [x] #3196
- [x] #3197
- [x] #3198
- [x] #3199
- [x] #3200
- [x] #3201
- [x] #3202
- [x] #3203
- [ ] In [`Cargo.toml`](https://github.com/firecracker-microvm/firecracker/blob/main/Cargo.toml) replace
```
ptr_as_ptr = "warn"
cast_lossless = "warn"
cast_possible_truncation = "warn"
cast_possible_wrap = "warn"
cast_sign_loss = "warn"
```
with
```
as_conversions = "warn"
```
and fix warnings.
Contributor guide
Assessment
This issue has not been assessed yet.