From cb6e8ccf911b197b2154189e9d75bcc7954ac9a9 Mon Sep 17 00:00:00 2001 From: Nickiel12 <35903114+Nickiel12@users.noreply.github.com> Date: Sat, 11 Dec 2021 02:23:45 -0800 Subject: [PATCH] renames, spacing adding, and derivings added --- .../stream_states/stream_states_class.rs | 19 +++++++++++-------- src/tests/message_handler_tests.rs | 0 2 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 src/tests/message_handler_tests.rs diff --git a/src/modules/stream_states/stream_states_class.rs b/src/modules/stream_states/stream_states_class.rs index 09e7fa6..2532bf2 100644 --- a/src/modules/stream_states/stream_states_class.rs +++ b/src/modules/stream_states/stream_states_class.rs @@ -1,5 +1,8 @@ +use std::{sync::mpsc::Receiver, thread}; + use super::enums::{self}; +#[derive(Debug, PartialEq, Clone)] pub enum StateUpdate { StreamRunning(bool), StreamIsMuted(bool), @@ -56,16 +59,16 @@ impl StreamStates { StreamStates{..Default::default()} } - pub fn update(mut self, updateMessage: StateUpdate) -> Self { - match updateMessage { - StateUpdate::StreamRunning(new_val) => {self.stream_running = new_val; self}, - StateUpdate::StreamIsMuted(new_val) => {self.stream_is_muted = new_val; self}, + pub fn update(mut self, update: StateUpdate) -> Self { + match update { + StateUpdate::StreamRunning(new_val) => {self.stream_running = new_val; self}, + StateUpdate::StreamIsMuted(new_val) => {self.stream_is_muted = new_val; self}, StateUpdate::ComputerSoundIsOn(new_val) => {self.computer_sound_is_on = new_val; self}, StateUpdate::ChangeSceneOnChangeSlideHotkey(new_val) => {self.change_scene_on_change_slide_hotkey = new_val; self}, - StateUpdate::TimerCanRun(new_val) => {self.timer_can_run = new_val; self}, - StateUpdate::TimerLength(new_val) => {self.timer_length = new_val; self}, - StateUpdate::TimerText(new_val) => {self.timer_text = new_val; self}, - StateUpdate::Scene(new_val) => {self.change_scene(&new_val)}, + StateUpdate::TimerCanRun(new_val) => {self.timer_can_run = new_val; self}, + StateUpdate::TimerLength(new_val) => {self.timer_length = new_val; self}, + StateUpdate::TimerText(new_val) => {self.timer_text = new_val; self}, + StateUpdate::Scene(new_val) => {self.change_scene(&new_val)}, StateUpdate::SceneIsAugmented(new_val) => { self.scene_is_augmented = new_val; self.change_scene(&enums::Scenes::Augmented)}, diff --git a/src/tests/message_handler_tests.rs b/src/tests/message_handler_tests.rs new file mode 100644 index 0000000..e69de29