Fix some small lifetime issues

This commit is contained in:
Elias Projahn 2021-02-15 17:33:50 +01:00
parent 0898bf63c9
commit ee42002d2e
2 changed files with 8 additions and 4 deletions

View file

@ -193,7 +193,7 @@ impl Screen<(), ()> for PlayerScreen {
// }));
this.list.set_make_widget_cb(clone!(@weak this => move |index| {
match this.items.borrow()[index] {
let widget = match this.items.borrow()[index] {
ListItem::Header(item_index) => {
let playlist_item = &this.playlist.borrow()[item_index];
let recording = &playlist_item.track_set.recording;
@ -246,7 +246,9 @@ impl Screen<(), ()> for PlayerScreen {
let separator = gtk::Separator::new(gtk::Orientation::Horizontal);
separator.upcast()
}
}
};
widget
}));
player.send_data();

View file

@ -86,7 +86,7 @@ impl Screen<Recording, ()> for RecordingScreen {
}));
this.list.set_make_widget_cb(clone!(@weak this => move |index| {
match this.items.borrow()[index] {
let widget = match this.items.borrow()[index] {
ListItem::Track(track_set_index, track_index) => {
let track_set = &this.track_sets.borrow()[track_set_index];
let track = &track_set.tracks[track_index];
@ -111,7 +111,9 @@ impl Screen<Recording, ()> for RecordingScreen {
let separator = gtk::Separator::new(gtk::Orientation::Horizontal);
separator.upcast()
}
}
};
widget
}));
// Load the content asynchronously.