From ea40e59f7fb626199a3e9c1071d2f2548e6bd043 Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Sat, 22 Jun 2024 22:46:10 +0200 Subject: [PATCH] Fix clippy warnings --- .pre-commit-config.yaml | 6 +++--- Cargo.toml | 14 +++++++------- src/input/mod.rs | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5d8a6e2..ca1a04b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -40,12 +40,12 @@ repos: hooks: - id: shellcheck - repo: https://github.com/codespell-project/codespell - rev: v2.2.6 + rev: v2.3.0 hooks: - id: codespell args: [--ignore-words=.codespellignore] - repo: https://github.com/sirosen/check-jsonschema - rev: 0.28.2 + rev: 0.28.5 hooks: - id: check-github-actions - id: check-github-workflows @@ -74,7 +74,7 @@ repos: - yaml # https://reuse.software - repo: https://github.com/fsfe/reuse-tool - rev: v3.0.2 + rev: v3.1.0a1 hooks: - id: reuse - repo: local diff --git a/Cargo.toml b/Cargo.toml index f20264e..0170b17 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,8 +15,8 @@ edition = "2021" include = ["README.md", "LICENSES", "src/"] [dependencies] -anyhow = "1.0.83" -derive_more = "0.99.17" +anyhow = "1.0.86" +derive_more = "0.99.18" float-cmp = "0.9.0" futures-core = { version = "0.3.30", default-features = false } futures-util = { version = "0.3.30", default-features = false, features = [ @@ -27,15 +27,15 @@ futures-util = { version = "0.3.30", default-features = false, features = [ is_sorted = "0.1.1" log = "0.4.21" strum = { version = "0.26.2", features = ["derive"] } -thiserror = "1.0.60" +thiserror = "1.0.61" # Optional dependencies -discro = { version = "0.29.2", optional = true } +discro = { version = "0.29.3", optional = true } midir = { version = "0.10.0", optional = true } -tokio = { version = "1.37.0", default-features = false, optional = true } +tokio = { version = "1.38.0", default-features = false, optional = true } # Optional dependencies (experimental features) -crossbeam-utils = { version = "0.8.19", optional = true } +crossbeam-utils = { version = "0.8.20", optional = true } enum-as-inner = { version = "0.6.0", optional = true } # Target dependent dependencies @@ -43,7 +43,7 @@ enum-as-inner = { version = "0.6.0", optional = true } hidapi = { version = "2.6.1", optional = true } [dev-dependencies] -anyhow = "1.0.83" +anyhow = "1.0.86" hidapi = "2.6.1" pretty_env_logger = "0.5.0" diff --git a/src/input/mod.rs b/src/input/mod.rs index e9d9ab7..ee73e7a 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -125,7 +125,7 @@ impl SliderInput { #[must_use] pub fn clamp_position(position: f32) -> f32 { - position.max(Self::MIN_POSITION).min(Self::MAX_POSITION) + position.clamp(Self::MIN_POSITION, Self::MAX_POSITION) } #[must_use] @@ -211,7 +211,7 @@ impl CenterSliderInput { #[must_use] pub fn clamp_position(position: f32) -> f32 { - position.max(Self::MIN_POSITION).min(Self::MAX_POSITION) + position.clamp(Self::MIN_POSITION, Self::MAX_POSITION) } #[must_use]