From e0db1f2705fc445c9007748e26ff85b7945a39d6 Mon Sep 17 00:00:00 2001 From: Lucas Meurer Date: Mon, 31 Aug 2026 16:20:47 +0200 Subject: [PATCH] Clippy --- crates/egui/src/widget_style/classes.rs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/crates/egui/src/widget_style/classes.rs b/crates/egui/src/widget_style/classes.rs index eb05c4426..c93f9224d 100644 --- a/crates/egui/src/widget_style/classes.rs +++ b/crates/egui/src/widget_style/classes.rs @@ -1,10 +1,9 @@ +use core::borrow::Borrow; use smallvec::SmallVec; -use std::borrow::{Borrow, Cow}; +use std::borrow::Cow; use std::fmt; use std::sync::Arc; -use crate::TextBuffer as _; - /// A class, used to customize widget styling and behavior. #[derive(Clone)] pub struct ClassName(ClassNameInner); @@ -24,7 +23,7 @@ impl ClassName { /// A class from anything that converts into one. #[inline] - pub fn new(class: impl Into) -> Self { + pub fn new(class: impl Into) -> Self { class.into() } @@ -76,9 +75,9 @@ impl From> for ClassName { } } -impl From<&ClassName> for ClassName { +impl From<&Self> for ClassName { #[inline] - fn from(class: &ClassName) -> Self { + fn from(class: &Self) -> Self { class.clone() } } @@ -97,7 +96,7 @@ impl AsRef for ClassName { } } -impl std::ops::Deref for ClassName { +impl core::ops::Deref for ClassName { type Target = str; #[inline] @@ -129,9 +128,9 @@ impl PartialEq<&str> for ClassName { } } -impl std::hash::Hash for ClassName { +impl core::hash::Hash for ClassName { #[inline] - fn hash(&self, state: &mut H) { + fn hash(&self, state: &mut H) { self.as_str().hash(state); } }