File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -80,12 +80,13 @@ declare_clippy_lint! {
80
80
/// ### What it does
81
81
/// Checks for casts between numerical types that may
82
82
/// truncate large values. This is expected behavior, so the cast is `Allow` by
83
- /// default.
83
+ /// default. This lint prompts user to either allow the lint if truncation is desired,
84
+ /// or suggests using `try_from` and handling the error.
84
85
///
85
86
/// ### Why is this bad?
86
87
/// In some problem domains, it is good practice to avoid
87
88
/// 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.
89
90
///
90
91
/// ### Example
91
92
/// ```rust
Original file line number Diff line number Diff line change 1
1
### What it does
2
2
Checks for casts between numerical types that may
3
3
truncate large values. This is expected behavior, so the cast is `Allow` by
4
- default.
4
+ default. This lint prompts user to either allow the lint if truncation is desired,
5
+ or suggests using `try_from` and handling the error.
5
6
6
7
### Why is this bad?
7
8
In some problem domains, it is good practice to avoid
8
9
truncation. This lint can be activated to help assess where additional
9
- checks could be beneficial, and suggests implementing TryFrom trait .
10
+ checks could be beneficial.
10
11
11
12
### Example
12
13
```
You can’t perform that action at this time.
0 commit comments