From 3f29916a0ad90019b153c66e38672fd5c2159333 Mon Sep 17 00:00:00 2001 From: Paris DOUADY Date: Tue, 5 Dec 2023 14:39:48 +0100 Subject: [PATCH] lints --- engine/src/shader.rs | 2 ++ geom/src/skeleton.rs | 2 +- native_app/src/rendering/orbit_camera.rs | 1 + simulation/src/map/objects/turn.rs | 2 +- simulation/src/map/turn_policy.rs | 1 + 5 files changed, 6 insertions(+), 2 deletions(-) diff --git a/engine/src/shader.rs b/engine/src/shader.rs index 07377cff..2d000862 100644 --- a/engine/src/shader.rs +++ b/engine/src/shader.rs @@ -1,3 +1,5 @@ +#![allow(clippy::redundant_pattern_matching)] + use crate::wgpu::ShaderSource; use common::FastMap; use std::borrow::Cow; diff --git a/geom/src/skeleton.rs b/geom/src/skeleton.rs index 228883b6..36824d05 100644 --- a/geom/src/skeleton.rs +++ b/geom/src/skeleton.rs @@ -124,7 +124,7 @@ impl Eq for Event {} impl PartialOrd for Event { fn partial_cmp(&self, other: &Self) -> Option { - self.distance().partial_cmp(&other.distance()) + Some(self.cmp(other)) } } diff --git a/native_app/src/rendering/orbit_camera.rs b/native_app/src/rendering/orbit_camera.rs index 2be47fa7..05af0efe 100644 --- a/native_app/src/rendering/orbit_camera.rs +++ b/native_app/src/rendering/orbit_camera.rs @@ -1,3 +1,4 @@ +#![allow(clippy::redundant_closure_call)] use crate::gui::windows::settings::Settings; use crate::inputmap::{InputAction, InputMap}; use common::saveload::Encoder; diff --git a/simulation/src/map/objects/turn.rs b/simulation/src/map/objects/turn.rs index 8580fe78..843e1c3f 100644 --- a/simulation/src/map/objects/turn.rs +++ b/simulation/src/map/objects/turn.rs @@ -54,7 +54,7 @@ impl Borrow for Turn { impl PartialOrd for Turn { fn partial_cmp(&self, other: &Self) -> Option { - self.id.partial_cmp(&other.id) + Some(self.cmp(other)) } } diff --git a/simulation/src/map/turn_policy.rs b/simulation/src/map/turn_policy.rs index ae5b83ec..51aadbd7 100644 --- a/simulation/src/map/turn_policy.rs +++ b/simulation/src/map/turn_policy.rs @@ -22,6 +22,7 @@ pub struct TurnPolicy { pub left_turns: bool, pub crosswalks: bool, #[inspect(proxy_type = "OptionDefault")] + #[serde(default, skip_serializing_if = "Option::is_none")] pub roundabout: Option, }