Skip to content

Commit fcdd08b

Browse files
navhxFrednet
authored andcommitted
update cast_possible_truncation documentation
1 parent 51aaba6 commit fcdd08b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clippy_lints/src/casts/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,13 @@ declare_clippy_lint! {
8080
/// ### What it does
8181
/// Checks for casts between numerical types that may
8282
/// truncate large values. This is expected behavior, so the cast is `Allow` by
83-
/// default.
83+
/// default. It suggests user either explicitly ignore the lint,
84+
/// or use `try_from()` and handle the truncation, default, or panic explicitly.
8485
///
8586
/// ### Why is this bad?
8687
/// In some problem domains, it is good practice to avoid
8788
/// truncation. This lint can be activated to help assess where additional
88-
/// checks could be beneficial, and suggests implementing TryFrom trait.
89+
/// checks could be beneficial.
8990
///
9091
/// ### Example
9192
/// ```rust

0 commit comments

Comments
 (0)