From d5f8425f86f16dee7ab795ccfed90ebe9d13c754 Mon Sep 17 00:00:00 2001 From: Andrei Benea Date: Sun, 4 Jun 2023 07:25:24 +0200 Subject: [PATCH 1/2] fix: use correct path to mod.rs and sort filenames for a stable output --- proto/generate.ers | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/proto/generate.ers b/proto/generate.ers index 32fde29..dd82418 100644 --- a/proto/generate.ers +++ b/proto/generate.ers @@ -46,10 +46,11 @@ fn main() { .collect::, io::Error>>() .unwrap(); // Get proto filenames without `.proto` extension - let input_filenames = input_files + let mut input_filenames = input_files .iter() .map(|file| file.file_stem().unwrap().to_str().unwrap()) .collect::>(); + input_filenames.sort(); println!("Proto files that will be generated: {:#?}", input_filenames); // Ask not to generate `mod.rs` file, we will do it ourselves @@ -98,7 +99,7 @@ fn main() { mod_file.push_str(line.as_str()); } // Write generated `mod.rs` file - output_dir.push("/mod.rs"); + output_dir.push("mod.rs"); fs::write(output_dir, mod_file).unwrap(); println!("✔ - Mod file generated"); } From c3315e46e89c3bd93170209fa8368bb2b84369e8 Mon Sep 17 00:00:00 2001 From: Andrei Benea Date: Sun, 4 Jun 2023 07:35:52 +0200 Subject: [PATCH 2/2] fix: disable warning for ambiguous_glob_reexports added in Rust 1.70 --- proto/generate.ers | 1 + src/messages/mod.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/proto/generate.ers b/proto/generate.ers index dd82418..498d619 100644 --- a/proto/generate.ers +++ b/proto/generate.ers @@ -91,6 +91,7 @@ fn main() { // Concatenate all this shit let mut mod_file = String::from("// This file is generated by `../proto/generate.ers`. Do not edit.\n\n"); + mod_file.push_str("#![allow(ambiguous_glob_reexports)]\n\n"); for line in module_lines { mod_file.push_str(line.as_str()); } diff --git a/src/messages/mod.rs b/src/messages/mod.rs index 9ae6e79..6d959a4 100644 --- a/src/messages/mod.rs +++ b/src/messages/mod.rs @@ -1,5 +1,7 @@ // This file is generated by `../proto/generate.ers`. Do not edit. +#![allow(ambiguous_glob_reexports)] + mod cstrike15_gcmessages; mod cstrike15_usermessages; mod engine_gcmessages;