version & fixed some clippy linting

This commit is contained in:
2026-05-14 23:34:11 +01:00
parent 90c5e464d2
commit a5a45fa1f0
11 changed files with 34 additions and 30 deletions
+5 -4
View File
@@ -21,7 +21,7 @@ mod character_parse;
// Returns success or an error string
pub fn token_parse(
tokens: &Vec<&str>,
characters: Arc<Mutex<HashMap::<String, character::Character>>>,
characters: &Arc<Mutex<HashMap::<String, character::Character>>>,
data_to_send: &Arc<Mutex<api::DataToSend>>,
rx: &Receiver<(bool,usize)>,
) -> Result<(),String>
@@ -48,7 +48,7 @@ pub fn token_parse(
let character_name: String = token.chars().skip(1).collect();
debug!("Doing something with a character: {character_name}");
// The index is incremented to after the character's instructions
index = match character_parse::character_parse(index+1, tokens, character_name, &characters, &data_to_send)
index = match character_parse::character_parse(index+1, tokens, character_name, characters, data_to_send)
{
Ok(increment) => increment,
Err((err,increment)) =>
@@ -70,12 +70,12 @@ pub fn token_parse(
},
"choice" =>
{
let (_,jump_points) = match choice_parse(index+1, tokens, &data_to_send)
let (_,jump_points) = match choice_parse(index+1, tokens, data_to_send)
{
Ok((increment,jump_point)) => (increment,jump_point),
Err(error) => return Err(error),
};
if rx.recv().is_err() { warn!("Error sending choices to client"); };
if rx.recv().is_err() { warn!("Error sending choices to client"); }
let (_, choice) = match rx.recv()
{
Ok((_,choice)) => (None::<bool>, choice),
@@ -151,5 +151,6 @@ fn choice_parse
data.content = String::new();
data.character = String::new();
data.choices = choices; //TODO
drop(data);
Ok((sum_index + 1, choice_indeces))
}