Skip to content

Commit be27fa7

Browse files
author
navh
committed
update documentation for cast
1 parent f4004b4 commit be27fa7

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
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. This lint prompts user to either allow the lint if truncation is desired,
84+
/// or suggests using `try_from` and handling the error.
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

src/docs/cast_possible_truncation.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
### What it does
22
Checks for casts between numerical types that may
33
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.
56

67
### Why is this bad?
78
In some problem domains, it is good practice to avoid
89
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.
1011

1112
### Example
1213
```

0 commit comments

Comments
 (0)