From 548386ef5405ba0e6a36e1a870c008b15fa9a44b Mon Sep 17 00:00:00 2001 From: yuni Date: Mon, 17 Jun 2024 01:16:53 +0200 Subject: [PATCH] cleanup --- src/game.rs | 5 ++++- src/main.rs | 2 +- src/menu.rs | 16 ++++++++-------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/game.rs b/src/game.rs index 0590498..6e016d3 100644 --- a/src/game.rs +++ b/src/game.rs @@ -184,7 +184,10 @@ pub fn handle_game_event( prefs.save(); } GameEvent::SetSound(cycle) => { - match cycle.to_index(settings.noise_cancellation_mode, &settings.noise_cancellation_modes) { + match cycle.to_index( + settings.noise_cancellation_mode, + &settings.noise_cancellation_modes, + ) { Some(mode) => { settings.set_noise_cancellation_mode(mode); } diff --git a/src/main.rs b/src/main.rs index c707c94..70d55bb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -34,8 +34,8 @@ pub mod prelude { pub use crate::{ actor, audio, camera, chat, cmd, common, game, hud, load, menu, nature, var, visual, world, }; - pub use game::Turn::Toggle; pub use game::Cycle::Next; + pub use game::Turn::Toggle; pub use game::{GameEvent, Turn}; } diff --git a/src/menu.rs b/src/menu.rs index 8e1ca9e..203c0ad 100644 --- a/src/menu.rs +++ b/src/menu.rs @@ -458,14 +458,14 @@ pub fn update_menu( match MENUDEF[i].1 { MenuAction::ToggleSound => { - let noisecancel = - if let Some(noisecancel) = - settings.noise_cancellation_modes.get(settings.noise_cancellation_mode) - { - noisecancel - } else { - &settings.noise_cancellation_modes[0] - }; + let noisecancel = if let Some(noisecancel) = settings + .noise_cancellation_modes + .get(settings.noise_cancellation_mode) + { + noisecancel + } else { + &settings.noise_cancellation_modes[0] + }; text.sections[i].value = format!("Noise Cancellation: {noisecancel}\n"); } MenuAction::ToggleMusic => {