diff options
Diffstat (limited to '')
-rw-r--r-- | src/tools/clippy/src/docs/implicit_saturating_sub.txt | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/src/tools/clippy/src/docs/implicit_saturating_sub.txt b/src/tools/clippy/src/docs/implicit_saturating_sub.txt deleted file mode 100644 index 03b47905a..000000000 --- a/src/tools/clippy/src/docs/implicit_saturating_sub.txt +++ /dev/null @@ -1,21 +0,0 @@ -### What it does -Checks for implicit saturating subtraction. - -### Why is this bad? -Simplicity and readability. Instead we can easily use an builtin function. - -### Example -``` -let mut i: u32 = end - start; - -if i != 0 { - i -= 1; -} -``` - -Use instead: -``` -let mut i: u32 = end - start; - -i = i.saturating_sub(1); -```
\ No newline at end of file |