mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 04:40:03 -04:00
Enable more clippy lints (#6853)
* Follows https://github.com/emilk/egui/pull/6848
This commit is contained in:
@@ -248,7 +248,7 @@ pub fn almost_equal(a: f32, b: f32, epsilon: f32) -> bool {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::approx_constant)]
|
||||
#[expect(clippy::approx_constant)]
|
||||
#[test]
|
||||
fn test_format() {
|
||||
assert_eq!(format_with_minimum_decimals(1_234_567.0, 0), "1234567");
|
||||
|
||||
@@ -23,7 +23,7 @@ macro_rules! impl_numeric_float {
|
||||
|
||||
#[inline(always)]
|
||||
fn to_f64(self) -> f64 {
|
||||
#[allow(trivial_numeric_casts)]
|
||||
#[allow(trivial_numeric_casts, clippy::allow_attributes)]
|
||||
{
|
||||
self as f64
|
||||
}
|
||||
@@ -31,7 +31,7 @@ macro_rules! impl_numeric_float {
|
||||
|
||||
#[inline(always)]
|
||||
fn from_f64(num: f64) -> Self {
|
||||
#[allow(trivial_numeric_casts)]
|
||||
#[allow(trivial_numeric_casts, clippy::allow_attributes)]
|
||||
{
|
||||
num as Self
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ impl Float for f64 {
|
||||
|
||||
// Keep this trait in private module, to avoid exposing its methods as extensions in user code
|
||||
mod private {
|
||||
use super::{Hash, Hasher};
|
||||
use super::{Hash as _, Hasher};
|
||||
|
||||
pub trait FloatImpl {
|
||||
fn is_nan(&self) -> bool;
|
||||
|
||||
@@ -115,7 +115,7 @@ fn simplest_digit_closed_range(min: i32, max: i32) -> i32 {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::approx_constant)]
|
||||
#[expect(clippy::approx_constant)]
|
||||
#[test]
|
||||
fn test_aim() {
|
||||
assert_eq!(best_in_range_f64(-0.2, 0.0), 0.0, "Prefer zero");
|
||||
|
||||
Reference in New Issue
Block a user