Fix borrowing bug in recording editor

This commit is contained in:
Elias Projahn 2022-03-02 19:33:25 +01:00
parent a0d1832122
commit 9a4ba8dd12

View file

@ -115,8 +115,8 @@ impl Screen<Option<Recording>, Recording> for RecordingEditor {
edit_button.connect_clicked(clone!(@weak this => move |_| {
spawn!(@clone this, async move {
let performance = &this.performances.borrow()[index];
if let Some(performance) = push!(this.handle, PerformanceEditor, Some(performance.to_owned())).await {
let performance = this.performances.borrow()[index].clone();
if let Some(performance) = push!(this.handle, PerformanceEditor, Some(performance)).await {
let length = {
let mut performances = this.performances.borrow_mut();
performances[index] = performance;