RS.CLIPPY.UNUSED_ROUNDING

Uselessly rounding a whole number floating-point literal

This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: unused_rounding. Copyright ©2025 The Rust Team. All rights reserved.

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;