added a modify data function for changing the data_to_send mutex
This commit is contained in:
@@ -12,7 +12,6 @@ use crate::
|
||||
info,
|
||||
debug,
|
||||
warn,
|
||||
UnwrapOrExit,
|
||||
};
|
||||
|
||||
mod strings;
|
||||
@@ -153,12 +152,7 @@ fn choice_parse
|
||||
}
|
||||
debug!("{choices:?}");
|
||||
// Send the choices to the Client via the API
|
||||
let mut data = data_to_send.lock().unwrap_or_exit("Data to send Mutex was poisoned",2);
|
||||
data.action_type = String::from("choice");
|
||||
data.content = String::new();
|
||||
data.character = String::new();
|
||||
data.choices = choices;
|
||||
drop(data);
|
||||
api::modify_data(data_to_send, "choice".to_string(), String::new(), String::new(), choices);
|
||||
// Return the choice indeces
|
||||
Ok((sum_index + 1, choice_indeces))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user