@@ -39,13 +39,13 @@ pub fn write_interfaces(
39
39
format : false ,
40
40
} ;
41
41
42
- write ! ( unformatted, "{}" , gen ) ?;
42
+ write ! ( unformatted, "{gen}" ) ?;
43
43
}
44
44
45
45
let formatted = match format_generated_code ( & unformatted) {
46
46
Ok ( formatted) => formatted,
47
47
Err ( e) => {
48
- eprintln ! ( "Failed to format generated code: {}" , e ) ;
48
+ eprintln ! ( "Failed to format generated code: {e}" ) ;
49
49
unformatted
50
50
}
51
51
} ;
@@ -86,16 +86,15 @@ fn write_doc_header<W: std::fmt::Write>(
86
86
write ! (
87
87
w,
88
88
"//!
89
- //! This code was generated by `{}` `{}` from D-Bus introspection data.
90
- //! Source: `{}`.
89
+ //! This code was generated by `{cargo_bin_name }` `{cargo_bin_version }` from D-Bus introspection data.
90
+ //! Source: `{input_src }`.
91
91
//!
92
92
//! You may prefer to adapt it, instead of using it verbatim.
93
93
//!
94
94
//! More information can be found in the [Writing a client proxy] section of the zbus
95
95
//! documentation.
96
96
//!
97
97
" ,
98
- cargo_bin_name, cargo_bin_version, input_src,
99
98
) ?;
100
99
101
100
if !standard_interfaces. is_empty ( ) {
@@ -112,9 +111,8 @@ fn write_doc_header<W: std::fmt::Write>(
112
111
write ! (
113
112
w,
114
113
"//!
115
- //! Consequently `{}` did not generate code for the above interfaces.
114
+ //! Consequently `{cargo_bin_name }` did not generate code for the above interfaces.
116
115
" ,
117
- cargo_bin_name,
118
116
) ?;
119
117
}
120
118
@@ -145,7 +143,7 @@ impl Display for GenTrait<'_> {
145
143
146
144
let formatted = format_generated_code ( & unformatted) . unwrap_or ( unformatted) ;
147
145
148
- write ! ( f, "{}" , formatted )
146
+ write ! ( f, "{formatted}" )
149
147
} else {
150
148
self . write_interface ( f)
151
149
}
@@ -213,14 +211,14 @@ impl GenTrait<'_> {
213
211
writeln ! ( w) ?;
214
212
writeln ! ( w, " /// {} property" , p. name( ) ) ?;
215
213
if p. access ( ) . read ( ) {
216
- writeln ! ( w, "{}" , fn_attribute ) ?;
214
+ writeln ! ( w, "{fn_attribute}" ) ?;
217
215
let output = to_rust_type ( p. ty ( ) , false , false ) ;
218
216
hide_clippy_type_complexity_lint ( w, p. ty ( ) ) ?;
219
217
writeln ! ( w, " fn {name}(&self) -> zbus::Result<{output}>;" , ) ?;
220
218
}
221
219
222
220
if p. access ( ) . write ( ) {
223
- writeln ! ( w, "{}" , fn_attribute ) ?;
221
+ writeln ! ( w, "{fn_attribute}" ) ?;
224
222
let input = to_rust_type ( p. ty ( ) , true , true ) ;
225
223
writeln ! (
226
224
w,
@@ -363,16 +361,16 @@ fn to_rust_type(ty: &Signature, input: bool, as_ref: bool) -> String {
363
361
Signature :: Array ( child) => {
364
362
let child_ty = signature_to_rust_type ( child, input, as_ref) ;
365
363
if input && as_ref {
366
- format ! ( "&[{}]" , child_ty )
364
+ format ! ( "&[{child_ty }]" )
367
365
} else {
368
- format ! ( "Vec<{}>" , child_ty )
366
+ format ! ( "Vec<{child_ty }>" )
369
367
}
370
368
}
371
369
Signature :: Dict { key, value } => {
372
370
let key_ty = signature_to_rust_type ( key, input, as_ref) ;
373
371
let value_ty = signature_to_rust_type ( value, input, as_ref) ;
374
372
375
- format ! ( "std::collections::HashMap<{}, {}>" , key_ty , value_ty )
373
+ format ! ( "std::collections::HashMap<{key_ty }, {value_ty }>" )
376
374
}
377
375
Signature :: Structure ( fields) => {
378
376
let fields = fields
0 commit comments