@@ -117,12 +117,17 @@ impl EnumBindGenerator {
117117 continue ;
118118 }
119119
120- let definition = line_trim. trim_start_matches ( "pub const " ) . trim_end_matches ( ';' ) ;
120+ let definition = line_trim
121+ . trim_start_matches ( "pub const " )
122+ . trim_end_matches ( ';' ) ;
121123
122124 let mut parts = definition. split ( ": Self = " ) ;
123125
124126 let variable_name = parts. next ( ) ?;
125- let variable_value = parts. next ( ) ?. trim_start_matches ( "Self(" ) . trim_end_matches ( ')' ) ;
127+ let variable_value = parts
128+ . next ( ) ?
129+ . trim_start_matches ( "Self(" )
130+ . trim_end_matches ( ')' ) ;
126131
127132 types. push ( ( variable_name, variable_value) ) ;
128133
@@ -143,11 +148,14 @@ impl EnumBindGenerator {
143148 let union_end_definition = "}\n " ;
144149 let union_end = contents[ union_start..] . find ( union_end_definition) . unwrap ( ) ;
145150
146- let union_definition =
147- & contents [ union_start + union_definition . len ( ) ..union_start + union_end - union_end_definition. len ( ) ] ;
151+ let union_definition = & contents [ union_start + union_definition . len ( )
152+ ..union_start + union_end - union_end_definition. len ( ) ] ;
148153
149154 for ( line, variable) in union_definition. split ( '\n' ) . zip ( & mut custom_types) {
150- let line_trim = line. trim ( ) . trim_start_matches ( & variable. name ) . trim_end_matches ( ',' ) ;
155+ let line_trim = line
156+ . trim ( )
157+ . trim_start_matches ( & variable. name )
158+ . trim_end_matches ( ',' ) ;
151159
152160 if line_trim. is_empty ( ) {
153161 variable. value = None ;
@@ -156,7 +164,9 @@ impl EnumBindGenerator {
156164
157165 variable. snake_case_name = camel_to_snake_case ( variable. name . as_str ( ) ) ;
158166
159- let new_type = line_trim. trim_start_matches ( "(Box<" ) . trim_end_matches ( "T>)" ) ;
167+ let new_type = line_trim
168+ . trim_start_matches ( "(Box<" )
169+ . trim_end_matches ( "T>)" ) ;
160170 variable. value = Some ( new_type. to_string ( ) ) ;
161171 }
162172
@@ -225,7 +235,10 @@ impl Generator for EnumBindGenerator {
225235 contents = contents. replace ( "\r \n " , "\n " ) ;
226236 }
227237
228- contents = contents. replace ( "use self::flatbuffers" , "use get_size::GetSize;\n use self::flatbuffers" ) ;
238+ contents = contents. replace (
239+ "use self::flatbuffers" ,
240+ "use get_size::GetSize;\n use self::flatbuffers" ,
241+ ) ;
229242
230243 contents = contents. replace (
231244 "#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]\n " ,
@@ -241,7 +254,10 @@ impl Generator for EnumBindGenerator {
241254 self ,
242255 "#[pyclass(module = \" rlbot_flatbuffers\" , frozen, hash, eq, eq_int)]"
243256 ) ;
244- write_str ! ( self , "#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)]" ) ;
257+ write_str ! (
258+ self ,
259+ "#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)]"
260+ ) ;
245261 write_fmt ! ( self , "pub enum {} {{" , self . struct_name) ;
246262 write_str ! ( self , " #[default]" ) ;
247263
@@ -261,7 +277,11 @@ impl Generator for EnumBindGenerator {
261277 self . struct_name,
262278 self . struct_name
263279 ) ;
264- write_fmt ! ( self , " fn from(flat_t: flat::{}) -> Self {{" , self . struct_name) ;
280+ write_fmt ! (
281+ self ,
282+ " fn from(flat_t: flat::{}) -> Self {{" ,
283+ self . struct_name
284+ ) ;
265285 write_str ! ( self , " match flat_t {" ) ;
266286
267287 for variable_info in & self . types {
@@ -274,7 +294,10 @@ impl Generator for EnumBindGenerator {
274294 ) ;
275295 }
276296
277- write_str ! ( self , " v => unreachable!(\" Unknown value: {v:?}\" )," ) ;
297+ write_str ! (
298+ self ,
299+ " v => unreachable!(\" Unknown value: {v:?}\" ),"
300+ ) ;
278301
279302 write_str ! ( self , " }" ) ;
280303 write_str ! ( self , " }" ) ;
@@ -289,7 +312,11 @@ impl Generator for EnumBindGenerator {
289312 self . struct_name,
290313 self . struct_name
291314 ) ;
292- write_fmt ! ( self , " fn from(py_type: &{}) -> Self {{" , self . struct_name) ;
315+ write_fmt ! (
316+ self ,
317+ " fn from(py_type: &{}) -> Self {{" ,
318+ self . struct_name
319+ ) ;
293320 write_str ! ( self , " match *py_type {" ) ;
294321
295322 for variable_info in & self . types {
0 commit comments