demostf / parser

Parsing of tf2 demo files
55 stars 17 forks source link

Serialize the Class enum as a string instead of an int #6

Closed 2l47 closed 2 years ago

2l47 commented 2 years ago

I feel like this is more legible and usable. Using Serialize instead of Serialize_repr in analyser.rs allows for serde_json::to_string to output instances of the Class enum as a class string instead of an int.

The crate's parse_demo binary still outputs classes as ints due to the usage of ClassList in the default analyser, so the json comparison test cases still pass.

icewind1991 commented 2 years ago

Thanks