Commit 9e09249d authored by Simon Goller's avatar Simon Goller Committed by Rahix

Format code

parent 0f20277f
......@@ -33,7 +33,6 @@ pub fn angel_system(args: TokenStream, input: TokenStream) -> TokenStream {
.into()
}
#[proc_macro_attribute]
pub fn wasm_bindgen_anyhow(_args: TokenStream, input: TokenStream) -> TokenStream {
let f = syn::parse_macro_input!(input as syn::ItemFn);
......
......@@ -30,8 +30,10 @@ impl<T> AnyhowWebExt<T> for Result<T, web_sys::Element> {
}
}
pub fn handle_system_result<F>(mut f: F)
where F: FnMut() -> anyhow::Result<()> {
pub fn handle_system_result<F>(mut f: F)
where
F: FnMut() -> anyhow::Result<()>,
{
if let Err(_) = f() {
panic!();
}
......
......@@ -194,7 +194,7 @@ impl StateMachineHandle {
self.do_transition(t)
}
pub fn do_cheat(&self, cheat: crate::cheats::CheatCommand) -> anyhow::Result<()>{
pub fn do_cheat(&self, cheat: crate::cheats::CheatCommand) -> anyhow::Result<()> {
self.do_event(Event::Cheat(cheat))
}
......
......@@ -124,8 +124,7 @@ impl gamestate::State for InGameState {
.resources
.get::<resources::Player>()
.context("Resource 'Player' not found")?
.0
;
.0;
let (player_movable, player) =
<(&mut components::Movable, &mut components::Player)>::query()
.get_mut(&mut self.world, player_id)
......@@ -199,8 +198,7 @@ impl gamestate::State for InGameState {
.resources
.get::<resources::Player>()
.context("Could not find resource 'Player'")?
.0
;
.0;
let player: &components::Player = <&components::Player>::query()
.get(&self.world, player_ent)
.context("Could not find Player")?;
......@@ -208,7 +206,9 @@ impl gamestate::State for InGameState {
player.shifts_completed += 1;
Ok(gamestate::Transition::replace(states::HeavenState::new(Some(player))?))
Ok(gamestate::Transition::replace(states::HeavenState::new(
Some(player),
)?))
} else if game_manager.wants_game_over() {
Ok(gamestate::Transition::replace(states::GameOverState::new()?))
} else {
......
......@@ -68,9 +68,12 @@ impl gamestate::State for LevelLoadingState {
sprites::Sprite::load_and_register_all(&mut rendering).await;
handle.do_transition(gamestate::Transition::replace(
states::InGameState::new(level, rendering, player.clone(), assigned_shift).unwrap(),
)).unwrap(); // ignore-unwrap - Inside a closure
handle
.do_transition(gamestate::Transition::replace(
states::InGameState::new(level, rendering, player.clone(), assigned_shift)
.unwrap(),
))
.unwrap(); // ignore-unwrap - Inside a closure
});
Ok(gamestate::Transition::Loop)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment