From 989b6cfb17a0bfb5ef2c0483e176f1802dc36117 Mon Sep 17 00:00:00 2001 From: yuni Date: Sun, 27 Oct 2024 02:01:47 +0100 Subject: [PATCH] cargo fmt --- src/game.rs | 8 ++------ src/menu.rs | 3 +-- src/nature.rs | 6 +++++- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/game.rs b/src/game.rs index a0d6228..52c49ed 100644 --- a/src/game.rs +++ b/src/game.rs @@ -150,9 +150,7 @@ impl Cycle { Some(current_index - 1) } } - Cycle::Unchanged => { - Some(current_index) - } + Cycle::Unchanged => Some(current_index), } } } @@ -288,9 +286,7 @@ pub fn handle_game_event( pronoun: None, talking_speed: 0.0, }; - ew_conv.send(chat::StartConversationEvent { - talker: talker, - }); + ew_conv.send(chat::StartConversationEvent { talker: talker }); } } } diff --git a/src/menu.rs b/src/menu.rs index 7888ee0..fd3a025 100644 --- a/src/menu.rs +++ b/src/menu.rs @@ -481,8 +481,7 @@ pub fn update_menu( id2pos.0.get(cmd::ID_PLAYER), id2pos.0.get(cmd::ID_JUPITER), ) { - let clock = if player_pos.y.abs() < 1e7 && player_pos.distance(*jupiter_pos) < 1e10 - { + let clock = if player_pos.y.abs() < 1e7 && player_pos.distance(*jupiter_pos) < 1e10 { let (clock_max, clock_current) = nature::pos_to_orbit_time(*player_pos, *jupiter_pos, nature::JUPITER_MASS); format!( diff --git a/src/nature.rs b/src/nature.rs index 8de51df..7c024fd 100644 --- a/src/nature.rs +++ b/src/nature.rs @@ -263,5 +263,9 @@ pub fn pos_to_orbit_time(pos: DVec3, orbited_pos: DVec3, orbited_mass: f64) -> ( } pub fn format_seconds_to_hour_min(seconds: f64) -> String { - return format!("{:02.0}:{:02.0}", seconds / 3600.0, (seconds % 3600.0) / 60.0); + return format!( + "{:02.0}:{:02.0}", + seconds / 3600.0, + (seconds % 3600.0) / 60.0 + ); }