diff options
Diffstat (limited to 'src/tools/clippy/src/docs/unused_rounding.txt')
-rw-r--r-- | src/tools/clippy/src/docs/unused_rounding.txt | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/tools/clippy/src/docs/unused_rounding.txt b/src/tools/clippy/src/docs/unused_rounding.txt new file mode 100644 index 000000000..70947acee --- /dev/null +++ b/src/tools/clippy/src/docs/unused_rounding.txt @@ -0,0 +1,17 @@ +### What it does + +Detects cases where a whole-number literal float is being rounded, using +the `floor`, `ceil`, or `round` methods. + +### Why is this bad? + +This is unnecessary and confusing to the reader. Doing this is probably a mistake. + +### Example +``` +let x = 1f32.ceil(); +``` +Use instead: +``` +let x = 1f32; +```
\ No newline at end of file |