From 4c872b1466a2dac8a6fd7acf7918d1d8342397f4 Mon Sep 17 00:00:00 2001 From: Jonathan Spira Date: Sun, 19 Jan 2025 11:13:30 -0500 Subject: [PATCH] fixes a chunk of clippy lints --- imgui/src/draw_list.rs | 12 ++++++------ imgui/src/lib.rs | 3 +-- imgui/src/list_clipper.rs | 2 +- imgui/src/render/draw_data.rs | 2 +- imgui/src/widget/tree.rs | 2 +- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/imgui/src/draw_list.rs b/imgui/src/draw_list.rs index d5a3dcc..345273f 100644 --- a/imgui/src/draw_list.rs +++ b/imgui/src/draw_list.rs @@ -84,7 +84,7 @@ static DRAW_LIST_LOADED_BACKGROUND: std::sync::atomic::AtomicBool = static DRAW_LIST_LOADED_FOREGROUND: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false); -impl<'ui> Drop for DrawListMut<'ui> { +impl Drop for DrawListMut<'_> { fn drop(&mut self) { match self.draw_list_type { DrawListType::Window => &DRAW_LIST_LOADED_WINDOW, @@ -95,7 +95,7 @@ impl<'ui> Drop for DrawListMut<'ui> { } } -impl<'ui> DrawListMut<'ui> { +impl DrawListMut<'_> { fn lock_draw_list(t: DrawListType) { let lock = match t { DrawListType::Window => &DRAW_LIST_LOADED_WINDOW, @@ -208,7 +208,7 @@ pub struct ChannelsSplit<'ui> { channels_count: u32, } -impl<'ui> ChannelsSplit<'ui> { +impl ChannelsSplit<'_> { /// Change current channel. /// /// Panic if channel_index overflows the number of channels. @@ -438,7 +438,7 @@ impl<'ui> DrawListMut<'ui> { texture_id: TextureId, p_min: impl Into, p_max: impl Into, - ) -> Image<'_> { + ) -> Image<'ui> { Image::new(self, texture_id, p_min, p_max) } @@ -452,7 +452,7 @@ impl<'ui> DrawListMut<'ui> { p2: impl Into, p3: impl Into, p4: impl Into, - ) -> ImageQuad<'_> { + ) -> ImageQuad<'ui> { ImageQuad::new(self, texture_id, p1, p2, p3, p4) } @@ -463,7 +463,7 @@ impl<'ui> DrawListMut<'ui> { p_min: impl Into, p_max: impl Into, rounding: f32, - ) -> ImageRounded<'_> { + ) -> ImageRounded<'ui> { ImageRounded::new(self, texture_id, p_min, p_max, rounding) } diff --git a/imgui/src/lib.rs b/imgui/src/lib.rs index 6c33713..770406a 100644 --- a/imgui/src/lib.rs +++ b/imgui/src/lib.rs @@ -502,7 +502,7 @@ impl Ui { impl<'ui> Ui { /// # Widgets: Input - + /// /// Edits text in a single line input widget #[doc(alias = "InputText", alias = "InputTextWithHint")] pub fn input_text<'p, L: AsRef>( @@ -752,7 +752,6 @@ impl Ui { /// ui.button("Dangerous button"); /// } /// ``` - #[doc(alias = "BeginDisabled")] pub fn begin_disabled(&self, disabled: bool) -> DisabledToken<'_> { unsafe { sys::igBeginDisabled(disabled) }; diff --git a/imgui/src/list_clipper.rs b/imgui/src/list_clipper.rs index a7c000c..61ea760 100644 --- a/imgui/src/list_clipper.rs +++ b/imgui/src/list_clipper.rs @@ -124,7 +124,7 @@ impl<'ui> ListClipperToken<'ui> { } } -impl<'ui> Drop for ListClipperToken<'ui> { +impl Drop for ListClipperToken<'_> { fn drop(&mut self) { unsafe { sys::ImGuiListClipper_destroy(self.list_clipper); diff --git a/imgui/src/render/draw_data.rs b/imgui/src/render/draw_data.rs index 977ce68..2918b2e 100644 --- a/imgui/src/render/draw_data.rs +++ b/imgui/src/render/draw_data.rs @@ -221,7 +221,7 @@ pub struct DrawCmdIterator<'a> { iter: std::slice::Iter<'a, sys::ImDrawCmd>, } -impl<'a> Iterator for DrawCmdIterator<'a> { +impl Iterator for DrawCmdIterator<'_> { type Item = DrawCmd; #[inline] diff --git a/imgui/src/widget/tree.rs b/imgui/src/widget/tree.rs index 68a1ad9..9b61d8d 100644 --- a/imgui/src/widget/tree.rs +++ b/imgui/src/widget/tree.rs @@ -334,7 +334,7 @@ impl<'a, T: AsRef, L: AsRef> TreeNode<'a, T, L> { #[derive(Debug)] pub struct TreeNodeToken<'a>(core::marker::PhantomData<&'a crate::Ui>, bool); -impl<'a> TreeNodeToken<'a> { +impl TreeNodeToken<'_> { /// Creates a new token type. This takes a bool for the no-op variant on NO_TREE_PUSH_ON_OPEN. pub(crate) fn new(_: &crate::Ui, execute_drop: bool) -> Self { Self(std::marker::PhantomData, execute_drop)