From ee42002d2e524abc31355a362955201e37f7eca1 Mon Sep 17 00:00:00 2001 From: Elias Projahn Date: Mon, 15 Feb 2021 17:33:50 +0100 Subject: [PATCH] Fix some small lifetime issues --- musicus/src/screens/player.rs | 6 ++++-- musicus/src/screens/recording.rs | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/musicus/src/screens/player.rs b/musicus/src/screens/player.rs index dfeb27c..7ab8b0e 100644 --- a/musicus/src/screens/player.rs +++ b/musicus/src/screens/player.rs @@ -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(); diff --git a/musicus/src/screens/recording.rs b/musicus/src/screens/recording.rs index c87c8ab..8bf1345 100644 --- a/musicus/src/screens/recording.rs +++ b/musicus/src/screens/recording.rs @@ -86,7 +86,7 @@ impl Screen 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 for RecordingScreen { let separator = gtk::Separator::new(gtk::Orientation::Horizontal); separator.upcast() } - } + }; + + widget })); // Load the content asynchronously.