chore:refacto clippy

This commit is contained in:
Henri Bourcereau 2025-08-17 15:59:53 +02:00
parent db9560dfac
commit 1dc29d0ff0
19 changed files with 98 additions and 95 deletions

View file

@ -59,7 +59,7 @@ impl App {
}
s if s.starts_with("dqnburn:") => {
let path = s.trim_start_matches("dqnburn:");
Some(Box::new(DqnBurnStrategy::new_with_model(&format!("{path}")))
Some(Box::new(DqnBurnStrategy::new_with_model(&path.to_string()))
as Box<dyn BotStrategy>)
}
_ => None,
@ -114,7 +114,7 @@ impl App {
pub fn show_history(&self) {
for hist in self.game.state.history.iter() {
println!("{:?}\n", hist);
println!("{hist:?}\n");
}
}
@ -192,7 +192,7 @@ impl App {
return;
}
}
println!("invalid move : {}", input);
println!("invalid move : {input}");
}
pub fn display(&mut self) -> String {

View file

@ -77,7 +77,7 @@ impl GameRunner {
} else {
debug!("{}", self.state);
error!("event not valid : {event:?}");
panic!("crash and burn {} \nevt not valid {event:?}", self.state);
// panic!("crash and burn {} \nevt not valid {event:?}", self.state);
&GameEvent::PlayError
};

View file

@ -35,7 +35,7 @@ fn main() -> Result<()> {
let args = match parse_args() {
Ok(v) => v,
Err(e) => {
eprintln!("Error: {}.", e);
eprintln!("Error: {e}.");
std::process::exit(1);
}
};
@ -63,7 +63,7 @@ fn parse_args() -> Result<AppArgs, pico_args::Error> {
// Help has a higher priority and should be handled separately.
if pargs.contains(["-h", "--help"]) {
print!("{}", HELP);
print!("{HELP}");
std::process::exit(0);
}
@ -78,7 +78,7 @@ fn parse_args() -> Result<AppArgs, pico_args::Error> {
// It's up to the caller what to do with the remaining arguments.
let remaining = pargs.finish();
if !remaining.is_empty() {
eprintln!("Warning: unused arguments left: {:?}.", remaining);
eprintln!("Warning: unused arguments left: {remaining:?}.");
}
Ok(args)