add a preferred fix for cast_possible_wrap description (#14225)

close #9250

changelog: none
This commit is contained in:
Alejandra González 2025-02-18 23:47:57 +00:00 committed by GitHub
commit 48fffe7db3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -134,8 +134,14 @@ declare_clippy_lint! {
///
/// ### Example
/// ```no_run
/// u32::MAX as i32; // will yield a value of `-1`
/// let _ = u32::MAX as i32; // will yield a value of `-1`
/// ```
///
/// Use instead:
/// ```no_run
/// let _ = i32::try_from(u32::MAX).ok();
/// ```
///
#[clippy::version = "pre 1.29.0"]
pub CAST_POSSIBLE_WRAP,
pedantic,