Skip to content

Commit 453237c

Browse files
felinirabilelmoussaoui
authored andcommitted
examples/list_box_model: Fix warning
1 parent 3359452 commit 453237c

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

examples/list_box_model/main.rs

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,13 @@ fn build_ui(application: &gtk::Application) {
4545
// The gtk::ListBoxRow can contain any possible widgets.
4646

4747
let listbox = gtk::ListBox::new();
48-
listbox.bind_model(
49-
Some(&model),
50-
clone!(
51-
#[weak]
52-
window,
53-
#[upgrade_or_panic]
54-
move |item| {
55-
ListBoxRow::new(
56-
item.downcast_ref::<RowData>()
57-
.expect("RowData is of wrong type"),
58-
)
59-
.upcast::<gtk::Widget>()
60-
}
61-
),
62-
);
48+
listbox.bind_model(Some(&model), move |item| {
49+
ListBoxRow::new(
50+
item.downcast_ref::<RowData>()
51+
.expect("RowData is of wrong type"),
52+
)
53+
.upcast::<gtk::Widget>()
54+
});
6355

6456
let scrolled_window = gtk::ScrolledWindow::builder()
6557
.hscrollbar_policy(gtk::PolicyType::Never) // Disable horizontal scrolling

0 commit comments

Comments
 (0)