mirror of
				https://github.com/a2x/cs2-dumper.git
				synced 2025-10-30 13:00:03 +08:00 
			
		
		
		
	Add token escaping for Rust output r#use
				
					
				
			This commit is contained in:
		| @@ -78,11 +78,12 @@ impl CodeGen for Vec<Button> { | ||||
|  | ||||
|                 fmt.block("pub mod buttons", false, |fmt| { | ||||
|                     for button in self { | ||||
|                         writeln!( | ||||
|                             fmt, | ||||
|                             "pub const {}: usize = {:#X};", | ||||
|                             button.name, button.value | ||||
|                         )?; | ||||
|                         let mut name = button.name.clone(); | ||||
|                         if name == "use" { | ||||
|                             name = format!("r#{}", name); | ||||
|                         } | ||||
|  | ||||
|                         writeln!(fmt, "pub const {}: usize = {:#X};", name, button.value)?; | ||||
|                     } | ||||
|  | ||||
|                     Ok(()) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user