Skip to content

Commit 0bd3378

Browse files
committed
fix: Add type annotation to Sessions create_with() calls
1 parent 79fcfe8 commit 0bd3378

File tree

5 files changed

+22
-18
lines changed

5 files changed

+22
-18
lines changed

src/debug.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ use bones_framework::debug::frame_time_diagnostics_plugin;
77
use bones_framework::networking::debug::network_debug_window;
88

99
pub fn game_plugin(game: &mut Game) {
10-
game.sessions.create_with(SessionNames::DEBUG, |builder| {
11-
builder
12-
.install_plugin(session_plugin)
13-
.install_plugin(frame_time_diagnostics_plugin);
14-
});
10+
game.sessions
11+
.create_with(SessionNames::DEBUG, |builder: &mut SessionBuilder| {
12+
builder
13+
.install_plugin(session_plugin)
14+
.install_plugin(frame_time_diagnostics_plugin);
15+
});
1516
}
1617

1718
fn session_plugin(session: &mut SessionBuilder) {

src/main.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ fn main() {
174174
// Create a new session for the pause menu, which sits in the background by default and only
175175
// does anything while the game is running.
176176
game.sessions
177-
.create_with(SessionNames::PAUSE_MENU, |builder| {
177+
.create_with(SessionNames::PAUSE_MENU, |builder: &mut SessionBuilder| {
178178
builder.install_plugin(ui::pause_menu::session_plugin);
179179
});
180180

@@ -184,16 +184,19 @@ fn main() {
184184
.unwrap()
185185
.priority = 1;
186186

187-
// Scoring menu plugin, activated by game between round tarnsitions when appropriate
188-
game.sessions.create_with(SessionNames::SCORING, |builder| {
189-
builder.install_plugin(ui::scoring::session_plugin);
190-
});
187+
// Scoring menu plugin, activated by game between round transitions when appropriate
188+
game.sessions
189+
.create_with(SessionNames::SCORING, |builder: &mut SessionBuilder| {
190+
builder.install_plugin(ui::scoring::session_plugin);
191+
});
191192

192193
// session for pop-ups / nofication UI
193-
game.sessions
194-
.create_with(SessionNames::NOTIFICATION, |builder| {
194+
game.sessions.create_with(
195+
SessionNames::NOTIFICATION,
196+
|builder: &mut SessionBuilder| {
195197
builder.install_plugin(ui::notification::session_plugin);
196-
});
198+
},
199+
);
197200

198201
// Create a bevy renderer for the bones game and run it.
199202
BonesBevyRenderer {

src/profiler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::prelude::*;
66
pub fn game_plugin(game: &mut Game) {
77
game.systems.add_before_system(mark_new_frame);
88
game.sessions
9-
.create_with(SessionNames::PROFILER, |builder| {
9+
.create_with(SessionNames::PROFILER, |builder: &mut SessionBuilder| {
1010
builder.install_plugin(session_plugin);
1111
});
1212
}

src/sessions.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub trait SessionExt {
2323

2424
impl SessionExt for Sessions {
2525
fn start_menu(&mut self) {
26-
self.create_with(SessionNames::MAIN_MENU, |builder| {
26+
self.create_with(SessionNames::MAIN_MENU, |builder: &mut SessionBuilder| {
2727
builder.install_plugin(crate::ui::main_menu::session_plugin);
2828
});
2929
}
@@ -74,7 +74,7 @@ impl SessionExt for Sessions {
7474
score
7575
};
7676

77-
self.create_with(SessionNames::GAME, |builder| {
77+
self.create_with(SessionNames::GAME, |builder: &mut SessionBuilder| {
7878
builder.install_plugin(crate::core::MatchPlugin {
7979
maps: map_pool,
8080
player_info,
@@ -89,7 +89,7 @@ impl SessionExt for Sessions {
8989
}
9090

9191
fn start_game(&mut self, match_plugin: crate::core::MatchPlugin) {
92-
self.create_with(SessionNames::GAME, |builder| {
92+
self.create_with(SessionNames::GAME, |builder: &mut SessionBuilder| {
9393
builder.install_plugin(match_plugin);
9494
});
9595
}

src/ui/pause_menu.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ fn pause_menu_system(
137137
.deref()
138138
.clone();
139139
sessions.end_game();
140-
sessions.create_with(SessionNames::GAME, |builder| {
140+
sessions.create_with(SessionNames::GAME, |builder: &mut SessionBuilder| {
141141
builder.install_plugin(crate::core::MatchPlugin {
142142
maps,
143143
player_info: std::array::from_fn(|i| PlayerInput {

0 commit comments

Comments
 (0)