diff --git a/masonry/src/widget/grid.rs b/masonry/src/widget/grid.rs index 261e184b5..a752aca9c 100644 --- a/masonry/src/widget/grid.rs +++ b/masonry/src/widget/grid.rs @@ -215,11 +215,7 @@ impl Grid { this: &'t mut WidgetMut<'_, Self>, idx: usize, ) -> Option>> { - let child = match this.widget.children[idx].widget_mut() { - Some(widget) => widget, - None => return None, - }; - + let child = this.widget.children[idx].widget_mut()?; Some(this.ctx.get_mut(child)) }