Skip to content

Commit

Permalink
Fix clippy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
viktorstrate committed Nov 16, 2024
1 parent ce93721 commit 7c21129
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions masonry/src/widget/zstack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}

Expand Down
13 changes: 7 additions & 6 deletions xilem/src/view/zstack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub struct ZStack<Seq> {
}

impl<Seq> ZStack<Seq> {
#[must_use]
pub fn alignment(mut self, alignment: impl Into<Alignment>) -> Self {
self.alignment = alignment.into();
self
Expand Down Expand Up @@ -55,7 +56,7 @@ where
prev: &Self,
view_state: &mut Self::ViewState,
ctx: &mut ViewCtx,
mut element: crate::core::Mut<Self::Element>,
mut element: Mut<Self::Element>,
) {
if self.alignment != prev.alignment {
widget::ZStack::set_alignment(&mut element, self.alignment);
Expand All @@ -71,7 +72,7 @@ where
&self,
view_state: &mut Self::ViewState,
ctx: &mut ViewCtx,
element: crate::core::Mut<Self::Element>,
element: Mut<Self::Element>,
) {
let mut splice = StackSplice::new(element);
self.sequence.seq_teardown(view_state, ctx, &mut splice);
Expand Down Expand Up @@ -108,8 +109,8 @@ impl SuperElement<ZStackElement, ViewCtx> for ZStackElement {
}

fn with_downcast_val<R>(
mut this: crate::core::Mut<Self>,
f: impl FnOnce(crate::core::Mut<ZStackElement>) -> R,
mut this: Mut<Self>,
f: impl FnOnce(Mut<ZStackElement>) -> R,
) -> (Self::Mut<'_>, R) {
let r = {
let parent = this.parent.reborrow_mut();
Expand All @@ -129,8 +130,8 @@ impl<W: Widget> SuperElement<Pod<W>, ViewCtx> for ZStackElement {
}

fn with_downcast_val<R>(
mut this: crate::core::Mut<Self>,
f: impl FnOnce(crate::core::Mut<Pod<W>>) -> R,
mut this: Mut<Self>,
f: impl FnOnce(Mut<Pod<W>>) -> R,
) -> (Self::Mut<'_>, R) {
let ret = {
let mut child = widget::ZStack::child_mut(&mut this.parent, this.idx)
Expand Down

0 comments on commit 7c21129

Please sign in to comment.