version & fixed some clippy linting
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user