fixes a chunk of clippy lints

This commit is contained in:
Jonathan Spira 2025-01-19 11:13:30 -05:00
parent c681d7d067
commit 4c872b1466
5 changed files with 10 additions and 11 deletions

View File

@ -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<MintVec2>,
p_max: impl Into<MintVec2>,
) -> Image<'_> {
) -> Image<'ui> {
Image::new(self, texture_id, p_min, p_max)
}
@ -452,7 +452,7 @@ impl<'ui> DrawListMut<'ui> {
p2: impl Into<MintVec2>,
p3: impl Into<MintVec2>,
p4: impl Into<MintVec2>,
) -> ImageQuad<'_> {
) -> ImageQuad<'ui> {
ImageQuad::new(self, texture_id, p1, p2, p3, p4)
}
@ -463,7 +463,7 @@ impl<'ui> DrawListMut<'ui> {
p_min: impl Into<MintVec2>,
p_max: impl Into<MintVec2>,
rounding: f32,
) -> ImageRounded<'_> {
) -> ImageRounded<'ui> {
ImageRounded::new(self, texture_id, p_min, p_max, rounding)
}

View File

@ -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<str>>(
@ -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) };

View File

@ -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);

View File

@ -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]

View File

@ -334,7 +334,7 @@ impl<'a, T: AsRef<str>, L: AsRef<str>> 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)