Box captured removal selection for compact review events
This commit is contained in:
@@ -13,7 +13,7 @@ pub(crate) mod view;
|
||||
pub(crate) enum Event {
|
||||
Begin {
|
||||
context: scenario::Context,
|
||||
snapshot: Snapshot,
|
||||
snapshot: Box<Snapshot>,
|
||||
},
|
||||
Query {
|
||||
token: u64,
|
||||
@@ -41,7 +41,7 @@ pub(crate) fn begin(app: &App) -> Option<Message> {
|
||||
let snapshot = app.multiselect_snapshot()?;
|
||||
(snapshot.targets().len() > 1).then_some(Message::ScenarioRemoval(Box::new(Event::Begin {
|
||||
context,
|
||||
snapshot,
|
||||
snapshot: Box::new(snapshot),
|
||||
})))
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ fn send(app: &mut App, event: Event) {
|
||||
fn captured(app: &App) -> Event {
|
||||
Event::Begin {
|
||||
context: app.scenario_context().unwrap(),
|
||||
snapshot: app.multiselect_snapshot().unwrap(),
|
||||
snapshot: Box::new(app.multiselect_snapshot().unwrap()),
|
||||
}
|
||||
}
|
||||
fn open(app: &mut App) -> u64 {
|
||||
|
||||
@@ -2154,7 +2154,7 @@ impl canvas::Program<Message> for Scene {
|
||||
Action::publish(Message::ScenarioRemoval(Box::new(
|
||||
crate::app::scenario_removal::Event::Begin {
|
||||
context,
|
||||
snapshot: snapshot.clone(),
|
||||
snapshot: Box::new(snapshot.clone()),
|
||||
},
|
||||
)))
|
||||
.and_capture(),
|
||||
|
||||
@@ -229,7 +229,7 @@ fn scenario_group_menus_capture_set_and_never_expose_partial_model_actions() {
|
||||
};
|
||||
assert_eq!(label, "Remove selected from Scenario…");
|
||||
assert_eq!(Some(*context), app.scenario_context());
|
||||
assert_eq!(captured, &snapshot);
|
||||
assert_eq!(captured.as_ref(), &snapshot);
|
||||
removals += 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user