diff --git a/egui/benches/benchmark.rs b/egui/benches/benchmark.rs index 7213be20..782b6aec 100644 --- a/egui/benches/benchmark.rs +++ b/egui/benches/benchmark.rs @@ -35,7 +35,7 @@ pub fn criterion_benchmark(c: &mut Criterion) { { let mut ctx = egui::Context::new(); - let mut ui = ctx.begin_frame(raw_input.clone()); + let mut ui = ctx.begin_frame(raw_input); c.bench_function("label", |b| { b.iter(|| { ui.label(egui::demos::LOREM_IPSUM_LONG); diff --git a/egui/src/lib.rs b/egui/src/lib.rs index e5e09541..690bea17 100644 --- a/egui/src/lib.rs +++ b/egui/src/lib.rs @@ -20,7 +20,7 @@ //! } //! ``` -#![deny(warnings)] +#![cfg_attr(not(debug_assertions), deny(warnings))] // Forbid warnings in release builds #![warn( clippy::all, clippy::dbg_macro, @@ -36,12 +36,10 @@ clippy::needless_continue, clippy::pub_enum_variant_names, clippy::rest_pat_in_fully_bound_structs, - // clippy::suboptimal_flops, // TODO clippy::todo, - // clippy::use_self, future_incompatible, nonstandard_style, - rust_2018_idioms, + rust_2018_idioms )] pub mod align; diff --git a/egui/src/math/mod.rs b/egui/src/math/mod.rs index d7018716..7cd2e369 100644 --- a/egui/src/math/mod.rs +++ b/egui/src/math/mod.rs @@ -159,6 +159,7 @@ pub fn almost_equal(a: f32, b: f32, epsilon: f32) -> bool { } } +#[allow(clippy::approx_constant)] #[test] fn test_format() { assert_eq!(format_with_minimum_precision(1_234_567.0, 0), "1234567"); @@ -204,6 +205,7 @@ fn test_almost_equal() { } } +#[allow(clippy::float_cmp)] #[test] fn test_remap() { assert_eq!(remap_clamp(1.0, 0.0..=1.0, 0.0..=16.0), 16.0); diff --git a/egui/src/math/smart_aim.rs b/egui/src/math/smart_aim.rs index c5cd90f1..b6770739 100644 --- a/egui/src/math/smart_aim.rs +++ b/egui/src/math/smart_aim.rs @@ -112,6 +112,7 @@ fn simplest_digit_closed_range(min: i32, max: i32) -> i32 { } } +#[allow(clippy::approx_constant)] #[test] fn test_aim() { assert_eq!(best_in_range_f64(-0.2, 0.0), 0.0, "Prefer zero");