From 16554e409e9f63d045c98e50d3f8d42bcffcee6c Mon Sep 17 00:00:00 2001 From: Nickiel12 <35903114+Nickiel12@users.noreply.github.com> Date: Sun, 2 Jan 2022 21:46:55 -0800 Subject: [PATCH] removed extra step and variable --- src/modules/stream_states/state_update.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/modules/stream_states/state_update.rs b/src/modules/stream_states/state_update.rs index 8670357..2402159 100644 --- a/src/modules/stream_states/state_update.rs +++ b/src/modules/stream_states/state_update.rs @@ -22,9 +22,8 @@ pub enum StateUpdate { impl StateUpdate { pub fn json_to_state_update(incoming_json: Value) -> Self { - let message_type = &incoming_json["type"]; - match message_type.as_str().unwrap() { + match incoming_json["type"].as_str().unwrap() { "update" => { let value = &incoming_json["update"]; match value.as_str().unwrap() {