removed extra step and variable

This commit is contained in:
Nickiel12 2022-01-02 21:46:55 -08:00
parent 24730ee3da
commit 16554e409e

View file

@ -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() {