1
0
Fork 0
mirror of https://codeberg.org/demostf/parser.git synced 2026-06-03 10:14:06 +02:00

clippy fixes

This commit is contained in:
Robin Appelman 2025-07-13 23:18:50 +02:00
commit f7190dca0f
13 changed files with 23 additions and 25 deletions

View file

@ -63,7 +63,7 @@ impl EntityDump {
.props(state)
.map(|prop| {
let (table_name, prop_name) = &prop_names[&prop.identifier];
(format!("{}.{}", table_name, prop_name), prop.value)
(format!("{table_name}.{prop_name}"), prop.value)
})
.collect(),
}

View file

@ -39,14 +39,14 @@ fn message_reencode(
setup_packet_files: &[&str],
setup_message_files: &[&str],
) {
let data = fs::read(format!("test_data/messages/{}", input_file)).unwrap();
let data = fs::read(format!("test_data/messages/{input_file}")).unwrap();
let mut handler = DemoHandler::parse_all_with_analyser(NullHandler);
for file in setup_packet_files {
setup_packet(&mut handler, &format!("test_data/messages/{}", file));
setup_packet(&mut handler, &format!("test_data/messages/{file}"));
}
for file in setup_message_files {
setup_message(&mut handler, &format!("test_data/messages/{}", file));
setup_message(&mut handler, &format!("test_data/messages/{file}"));
}
let state = &handler.state_handler;

View file

@ -72,7 +72,7 @@ fn flatten_test(input_file: &str) {
.into_iter()
.map(|prop| {
let (table_name, prop_name) = &prop_names[&prop.identifier];
format!("{}.{}", table_name, prop_name)
format!("{table_name}.{prop_name}")
})
.collect(),
)

View file

@ -15,7 +15,7 @@ use tf_demo_parser::{Demo, DemoParser};
#[test_case("emptysaytext.dem")]
#[test_case("protocol23.dem")]
fn snapshot_test(input_file: &str) {
let file = fs::read(format!("test_data/{}", input_file)).expect("Unable to read file");
let file = fs::read(format!("test_data/{input_file}")).expect("Unable to read file");
let demo = Demo::new(&file);
let (_, state) = DemoParser::new(demo.get_stream()).parse().unwrap();
@ -28,7 +28,7 @@ fn snapshot_test(input_file: &str) {
#[test_case("small.dem")]
#[test_case("gully.dem")]
fn game_state_test(input_file: &str) {
let file = fs::read(format!("test_data/{}", input_file)).expect("Unable to read file");
let file = fs::read(format!("test_data/{input_file}")).expect("Unable to read file");
let demo = Demo::new(&file);
let (_, mut state) = DemoParser::new_with_analyser(demo.get_stream(), GameStateAnalyser::new())
.parse()