fix(ui): drop RefCell borrow before match statement in populate. Extracts model.borrow().kind to a local variable to drop the temporary immutable borrow before entering 'populate_*' arms, preventing a runtime panic when nested functions attempt a mutable borrrow.
This commit is contained in:
parent
bde95e4bd6
commit
2b174ee792
1 changed files with 3 additions and 1 deletions
|
|
@ -564,7 +564,9 @@ fn populate(content: &GBox, model: &Rc<RefCell<Model>>, status: &Label) {
|
|||
Rc::new(move || rerender(&content, &model, &status))
|
||||
};
|
||||
|
||||
match model.borrow().kind {
|
||||
let kind = model.borrow().kind;
|
||||
|
||||
match kind {
|
||||
SchemaKind::Unknown => populate_unknown(content, status),
|
||||
SchemaKind::Flat => populate_flat(content, model, status, &rerender),
|
||||
SchemaKind::MultiLayout => populate_multi_layout(content, model, &rerender),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue