From 7c21129daf686794addacf0d80a6941ef2b6f85f Mon Sep 17 00:00:00 2001 From: viktorstrate Date: Sat, 16 Nov 2024 22:53:03 +0100 Subject: [PATCH] Fix clippy issues --- masonry/src/widget/zstack.rs | 4 ++-- xilem/src/view/zstack.rs | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/masonry/src/widget/zstack.rs b/masonry/src/widget/zstack.rs index 16ae0cecb..0ab9f42ff 100644 --- a/masonry/src/widget/zstack.rs +++ b/masonry/src/widget/zstack.rs @@ -257,8 +257,8 @@ impl Widget for ZStack { fn accessibility(&mut self, _ctx: &mut AccessCtx, _node: &mut NodeBuilder) {} - fn make_trace_span(&self, _ctx: &QueryCtx<'_>) -> tracing::Span { - trace_span!("ZStack") + fn make_trace_span(&self, ctx: &QueryCtx<'_>) -> tracing::Span { + trace_span!("ZStack", id = ctx.widget_id().trace()) } } diff --git a/xilem/src/view/zstack.rs b/xilem/src/view/zstack.rs index a8848aac6..999ea1deb 100644 --- a/xilem/src/view/zstack.rs +++ b/xilem/src/view/zstack.rs @@ -23,6 +23,7 @@ pub struct ZStack { } impl ZStack { + #[must_use] pub fn alignment(mut self, alignment: impl Into) -> Self { self.alignment = alignment.into(); self @@ -55,7 +56,7 @@ where prev: &Self, view_state: &mut Self::ViewState, ctx: &mut ViewCtx, - mut element: crate::core::Mut, + mut element: Mut, ) { if self.alignment != prev.alignment { widget::ZStack::set_alignment(&mut element, self.alignment); @@ -71,7 +72,7 @@ where &self, view_state: &mut Self::ViewState, ctx: &mut ViewCtx, - element: crate::core::Mut, + element: Mut, ) { let mut splice = StackSplice::new(element); self.sequence.seq_teardown(view_state, ctx, &mut splice); @@ -108,8 +109,8 @@ impl SuperElement for ZStackElement { } fn with_downcast_val( - mut this: crate::core::Mut, - f: impl FnOnce(crate::core::Mut) -> R, + mut this: Mut, + f: impl FnOnce(Mut) -> R, ) -> (Self::Mut<'_>, R) { let r = { let parent = this.parent.reborrow_mut(); @@ -129,8 +130,8 @@ impl SuperElement, ViewCtx> for ZStackElement { } fn with_downcast_val( - mut this: crate::core::Mut, - f: impl FnOnce(crate::core::Mut>) -> R, + mut this: Mut, + f: impl FnOnce(Mut>) -> R, ) -> (Self::Mut<'_>, R) { let ret = { let mut child = widget::ZStack::child_mut(&mut this.parent, this.idx)