From cfee6d91214b0926b4ab07e1773e0131ee2c3852 Mon Sep 17 00:00:00 2001 From: Lucas Schwiderski Date: Sat, 11 May 2024 19:15:45 +0200 Subject: [PATCH] Fix clippy lints --- Cargo.toml | 1 + crates/dtmm/src/main.rs | 1 - crates/dtmm/src/state/lens.rs | 1 + crates/dtmm/src/ui/theme/colors.rs | 13 ------------- crates/dtmm/src/ui/widget/mod.rs | 5 ----- lib/color-eyre | 2 +- 6 files changed, 3 insertions(+), 20 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4bab0cd..11831e4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,6 +9,7 @@ members = [ "lib/serde_sjson", "lib/luajit2-sys", ] +exclude = ["lib/color-eyre"] [patch.crates-io] color-eyre = { path = "lib/color-eyre" } diff --git a/crates/dtmm/src/main.rs b/crates/dtmm/src/main.rs index b9c1daf..aa223f0 100644 --- a/crates/dtmm/src/main.rs +++ b/crates/dtmm/src/main.rs @@ -1,6 +1,5 @@ #![recursion_limit = "256"] #![feature(let_chains)] -#![feature(arc_unwrap_or_clone)] #![feature(iterator_try_collect)] #![windows_subsystem = "windows"] diff --git a/crates/dtmm/src/state/lens.rs b/crates/dtmm/src/state/lens.rs index c26c298..983cb2e 100644 --- a/crates/dtmm/src/state/lens.rs +++ b/crates/dtmm/src/state/lens.rs @@ -42,6 +42,7 @@ impl Lens>> for SelectedModLens { /// A Lens that maps an `im::Vector` to `im::Vector<(usize, T)>`, /// where each element in the destination vector includes its index in the /// source vector. +#[allow(dead_code)] pub(crate) struct IndexedVectorLens; impl Lens, Vector<(usize, T)>> for IndexedVectorLens { diff --git a/crates/dtmm/src/ui/theme/colors.rs b/crates/dtmm/src/ui/theme/colors.rs index 2c2bf78..1051539 100644 --- a/crates/dtmm/src/ui/theme/colors.rs +++ b/crates/dtmm/src/ui/theme/colors.rs @@ -69,23 +69,10 @@ pub mod gruvbox_dark { } pub trait ColorExt { - fn lighten(&self, fac: f32) -> Self; fn darken(&self, fac: f32) -> Self; } impl ColorExt for Color { - fn lighten(&self, fac: f32) -> Self { - let (r, g, b, a) = self.as_rgba(); - let rgb = Rgb::from(r as f32, g as f32, b as f32); - let rgb = rgb.lighten(fac); - Self::rgba( - rgb.get_red() as f64, - rgb.get_green() as f64, - rgb.get_blue() as f64, - a, - ) - } - fn darken(&self, fac: f32) -> Self { let (r, g, b, a) = self.as_rgba(); let rgb = Rgb::from(r as f32, g as f32, b as f32); diff --git a/crates/dtmm/src/ui/widget/mod.rs b/crates/dtmm/src/ui/widget/mod.rs index 05c91c7..06ccedd 100644 --- a/crates/dtmm/src/ui/widget/mod.rs +++ b/crates/dtmm/src/ui/widget/mod.rs @@ -2,16 +2,11 @@ use std::path::PathBuf; use std::sync::Arc; use druid::text::Formatter; -use druid::{Data, Widget}; pub mod border; pub mod button; pub mod controller; -pub trait ExtraWidgetExt: Widget + Sized + 'static {} - -impl + 'static> ExtraWidgetExt for W {} - pub(crate) struct PathBufFormatter; impl PathBufFormatter { diff --git a/lib/color-eyre b/lib/color-eyre index 8a3d454..b40962a 160000 --- a/lib/color-eyre +++ b/lib/color-eyre @@ -1 +1 @@ -Subproject commit 8a3d4544046f956e8e28c906553dc54d325368c1 +Subproject commit b40962a61c748756d7da293d9fff26aca019603e