Skip to content

Commit bfed18a

Browse files
committed
fix ci
1 parent c0aac3f commit bfed18a

File tree

3 files changed

+30
-19
lines changed

3 files changed

+30
-19
lines changed

crates/bevy_ecs/src/schedule/stepping.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,7 @@ mod tests {
828828
use super::*;
829829
use crate::{prelude::*, schedule::ScheduleLabel};
830830
use alloc::{format, vec};
831+
use slotmap::SlotMap;
831832
use std::println;
832833

833834
#[derive(ScheduleLabel, Clone, Debug, PartialEq, Eq, Hash)]
@@ -1470,10 +1471,11 @@ mod tests {
14701471
// helper to build a cursor tuple for the supplied schedule
14711472
fn cursor(schedule: &Schedule, index: usize) -> (InternedScheduleLabel, NodeId) {
14721473
let node_id = schedule.executable().system_ids[index];
1473-
(schedule.label(), node_id)
1474+
(schedule.label(), NodeId::System(node_id))
14741475
}
14751476

14761477
let mut world = World::new();
1478+
let mut slotmap = SlotMap::<SystemKey, ()>::with_key();
14771479

14781480
// create two schedules with a number of systems in them
14791481
let mut schedule_a = Schedule::new(TestScheduleA);
@@ -1520,16 +1522,21 @@ mod tests {
15201522
]
15211523
);
15221524

1525+
let sys0 = slotmap.insert(());
1526+
let sys1 = slotmap.insert(());
1527+
let _sys2 = slotmap.insert(());
1528+
let sys3 = slotmap.insert(());
1529+
15231530
// reset our cursor (disable/enable), and update stepping to test if the
15241531
// cursor properly skips over AlwaysRun & NeverRun systems. Also set
15251532
// a Break system to ensure that shows properly in the cursor
15261533
stepping
15271534
// disable/enable to reset cursor
15281535
.disable()
15291536
.enable()
1530-
.set_breakpoint_node(TestScheduleA, NodeId::System(1))
1531-
.always_run_node(TestScheduleA, NodeId::System(3))
1532-
.never_run_node(TestScheduleB, NodeId::System(0));
1537+
.set_breakpoint_node(TestScheduleA, NodeId::System(sys1))
1538+
.always_run_node(TestScheduleA, NodeId::System(sys3))
1539+
.never_run_node(TestScheduleB, NodeId::System(sys0));
15331540

15341541
let mut cursors = Vec::new();
15351542
for _ in 0..9 {

examples/games/stepping.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ fn build_ui(
139139
// Add an entry to our systems list so we can find where to draw
140140
// the cursor when the stepping cursor is at this system
141141
// we add plus 1 to account for the empty root span
142-
state.systems.push((*label, node_id, text_spans.len() + 1));
142+
state
143+
.systems
144+
.push((*label, NodeId::System(node_id), text_spans.len() + 1));
143145

144146
// Add a text section for displaying the cursor for this system
145147
text_spans.push((
@@ -158,7 +160,7 @@ fn build_ui(
158160
}
159161

160162
for (label, node) in always_run.drain(..) {
161-
stepping.always_run_node(label, node);
163+
stepping.always_run_node(label, NodeId::System(node));
162164
}
163165

164166
commands.spawn((

release-content/migration-guides/schedule_slotmaps.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,27 @@ In order to support removing systems from schedules, `Vec`s storing `System`s an
88
reusing indices. The maps are respectively keyed by `SystemKey`s and `SystemSetKey`s.
99

1010
The following signatures were changed:
11+
1112
- `NodeId::System`: Now stores a `SystemKey` instead of a plain `usize`
1213
- `NodeId::Set`: Now stores a `SystemSetKey` instead of a plain `usize`
1314
- `ScheduleBuildPass::collapse_set`: Now takes the type-specific keys. Wrap them back into a `NodeId` if necessary.
1415
- The following functions now return the type-specific keys. Wrap them back into a `NodeId` if necessary.
15-
- `Schedule::systems`
16-
- `ScheduleGraph::systems`
17-
- `ScheduleGraph::system_sets`
18-
- `ScheduleGraph::conflicting_systems`
16+
- `Schedule::systems`
17+
- `ScheduleGraph::systems`
18+
- `ScheduleGraph::system_sets`
19+
- `ScheduleGraph::conflicting_systems`
1920
- Use the appropriate key types to index these structures rather than bare `usize`s:
20-
- `ScheduleGraph::systems` field
21-
- `ScheduleGraph::system_conditions`
21+
- `ScheduleGraph::systems` field
22+
- `ScheduleGraph::system_conditions`
2223
- The following functions now take the type-specific keys. Use pattern matching to extract them from `NodeId`s, if necessary:
23-
- `ScheduleGraph::get_system_at`
24-
- `ScheduleGraph::system_at`
25-
- `ScheduleGraph::get_set_at`
26-
- `ScheduleGraph::set_at`
27-
- `ScheduleGraph::get_set_conditions_at`
28-
- `ScheduleGraph::set_conditions_at`
24+
- `ScheduleGraph::get_system_at`
25+
- `ScheduleGraph::system_at`
26+
- `ScheduleGraph::get_set_at`
27+
- `ScheduleGraph::set_at`
28+
- `ScheduleGraph::get_set_conditions_at`
29+
- `ScheduleGraph::set_conditions_at`
2930

3031
The following functions were removed:
32+
3133
- `NodeId::index`: You should match on and use the `SystemKey` and `SystemSetKey` instead.
32-
- `NodeId::cmp`: Use the `PartialOrd` and `Ord` traits instead.
34+
- `NodeId::cmp`: Use the `PartialOrd` and `Ord` traits instead.

0 commit comments

Comments
 (0)