@@ -237,7 +237,7 @@ impl<'ns, 'c> NamespaceGenerator<'ns, 'c> {
237237 } ;
238238 self . emit_event_opcode ( name, number, event_full_def, out) ;
239239
240- let full_name = format ! ( "{}Event" , name ) ;
240+ let full_name = format ! ( "{name }Event" ) ;
241241
242242 let fields = event_full_def. fields . borrow ( ) ;
243243 let mut derives = Derives :: all ( ) ;
@@ -346,7 +346,7 @@ impl<'ns, 'c> NamespaceGenerator<'ns, 'c> {
346346 |field_name| {
347347 let rust_field_name = to_rust_variable_name ( field_name) ;
348348 if !deducible_fields. contains_key ( field_name) {
349- format ! ( "input.{}" , rust_field_name )
349+ format ! ( "input.{rust_field_name}" )
350350 } else {
351351 rust_field_name
352352 }
@@ -536,7 +536,7 @@ impl<'ns, 'c> NamespaceGenerator<'ns, 'c> {
536536 )
537537 } ;
538538 if let Some ( list_length) = list_field. length ( ) {
539- format ! ( "[{}; {}]" , element_type , list_length )
539+ format ! ( "[{element_type }; {list_length }]" )
540540 } else {
541541 unreachable ! ( ) ;
542542 }
@@ -956,16 +956,15 @@ impl<'ns, 'c> NamespaceGenerator<'ns, 'c> {
956956 if let xcbdefs:: FieldDef :: Normal ( normal_field) = field {
957957 let rust_type = self . field_value_type_to_rust_type ( & normal_field. type_ ) ;
958958 let rust_list_field_name = to_rust_variable_name ( list_field_name) ;
959- let msg = format ! ( "`{}` has too many elements" , rust_list_field_name ) ;
959+ let msg = format ! ( "`{rust_list_field_name }` has too many elements" ) ;
960960 let list_len = format ! ( "{}.len()" , wrap_field_ref( & rust_list_field_name) ) ;
961961 let value = match op {
962962 DeducibleLengthFieldOp :: None => {
963- format ! ( "{}::try_from({}).expect(\" {}\" )" , rust_type , list_len , msg )
963+ format ! ( "{rust_type }::try_from({list_len }).expect(\" {msg }\" )" )
964964 }
965965 DeducibleLengthFieldOp :: Mul ( n) => format ! (
966- "{}::try_from({}).ok().and_then(|len| \
967- len.checked_mul({})).expect(\" {}\" )",
968- rust_type, list_len, n, msg,
966+ "{rust_type}::try_from({list_len}).ok().and_then(|len| \
967+ len.checked_mul({n})).expect(\" {msg}\" )"
969968 ) ,
970969 DeducibleLengthFieldOp :: Div ( n) => {
971970 outln ! (
@@ -977,10 +976,7 @@ impl<'ns, 'c> NamespaceGenerator<'ns, 'c> {
977976 rust_list_field_name,
978977 n,
979978 ) ;
980- format ! (
981- "{}::try_from({} / {}).expect(\" {}\" )" ,
982- rust_type, list_len, n, msg,
983- )
979+ format ! ( "{rust_type}::try_from({list_len} / {n}).expect(\" {msg}\" )" )
984980 }
985981 } ;
986982 outln ! ( out, "let {} = {};" , dst_var_name, value) ;
@@ -1123,7 +1119,7 @@ impl<'ns, 'c> NamespaceGenerator<'ns, 'c> {
11231119 // Prevent rustdoc interpreting many leading spaces as code examples (?)
11241120 for line in text. trim ( ) . split ( '\n' ) {
11251121 let line = line. trim ( ) ;
1126- let line = format ! ( "{} {}" , prefix_char , line ) ;
1122+ let line = format ! ( "{prefix_char } {line}" ) ;
11271123 prefix_char = ' ' ;
11281124 if line. trim ( ) . is_empty ( ) {
11291125 outln ! ( out, "///" ) ;
@@ -1305,7 +1301,7 @@ impl<'ns, 'c> NamespaceGenerator<'ns, 'c> {
13051301 _ => None ,
13061302 } ;
13071303 if let Some ( ref type_) = wire_type {
1308- write ! ( s, "{}::from(" , type_ ) . unwrap ( ) ;
1304+ write ! ( s, "{type_ }::from(" ) . unwrap ( ) ;
13091305 }
13101306 s. push_str ( & wrap_name ( & ext_param. name ) ) ;
13111307 if wire_type. is_some ( ) {
@@ -1325,9 +1321,9 @@ impl<'ns, 'c> NamespaceGenerator<'ns, 'c> {
13251321 xcbdefs:: FieldDef :: List ( list_field) => {
13261322 let element_type = self . field_value_type_to_rust_type ( & list_field. element_type ) ;
13271323 if let Some ( list_len) = list_field. length ( ) {
1328- format ! ( "[{}; {}]" , element_type , list_len )
1324+ format ! ( "[{element_type }; {list_len }]" )
13291325 } else {
1330- format ! ( "Vec<{}>" , element_type )
1326+ format ! ( "Vec<{element_type }>" )
13311327 }
13321328 }
13331329 xcbdefs:: FieldDef :: Switch ( switch_field) => {
0 commit comments