1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-02 06:40:06 -04:00

#![allow(clippy::float_cmp)] everywhere

it has always been an annoyance, never a help
This commit is contained in:
Emil Ernerfeldt
2021-05-09 14:00:53 +02:00
parent 6ad6f56cb1
commit fb5176c133
14 changed files with 7 additions and 24 deletions

View File

@@ -301,7 +301,7 @@ impl Prepared {
let unbounded_offset_y = state.offset.y;
state.offset.y = state.offset.y.max(0.0);
state.offset.y = state.offset.y.min(max_offset);
#[allow(clippy::float_cmp)]
if state.offset.y != unbounded_offset_y {
state.vel = Vec2::ZERO;
}

View File

@@ -294,6 +294,7 @@
nonstandard_style,
rust_2018_idioms
)]
#![allow(clippy::float_cmp)]
#![allow(clippy::manual_range_contains)]
mod animation_manager;

View File

@@ -1055,8 +1055,6 @@ impl Ui {
/// Modify an angle. The given angle should be in radians, but is shown to the user in degrees.
/// The angle is NOT wrapped, so the user may select, for instance 720° = 2𝞃 = 4π
pub fn drag_angle(&mut self, radians: &mut f32) -> Response {
#![allow(clippy::float_cmp)]
let mut degrees = radians.to_degrees();
let mut response = self.add(DragValue::new(&mut degrees).speed(1.0).suffix("°"));
@@ -1073,8 +1071,6 @@ impl Ui {
/// but is shown to the user in fractions of one Tau (i.e. fractions of one turn).
/// The angle is NOT wrapped, so the user may select, for instance 2𝞃 (720°)
pub fn drag_angle_tau(&mut self, radians: &mut f32) -> Response {
#![allow(clippy::float_cmp)]
use std::f32::consts::TAU;
let mut taus = *radians / TAU;

View File

@@ -334,10 +334,7 @@ impl<'a> Widget for DragValue<'a> {
response
};
#[allow(clippy::float_cmp)]
{
response.changed = get(&mut get_set_value) != value;
}
response.changed = get(&mut get_set_value) != value;
response.widget_info(|| WidgetInfo::drag_value(value));
response

View File

@@ -423,7 +423,6 @@ impl Widget for Plot {
} else {
ui.input().zoom_delta_2d()
};
#[allow(clippy::float_cmp)]
if zoom_factor != Vec2::splat(1.0) {
transform.zoom(zoom_factor, hover_pos);
auto_bounds = false;

View File

@@ -1,5 +1,4 @@
#![allow(clippy::needless_pass_by_value)] // False positives with `impl ToString`
#![allow(clippy::float_cmp)]
use crate::{widgets::Label, *};
use std::ops::RangeInclusive;