@@ -54,13 +54,13 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
54
54
settings. version_string( ) ,
55
55
arch
56
56
) ;
57
- let package_name = format ! ( "{}.deb" , package_base_name ) ;
57
+ let package_name = format ! ( "{package_base_name }.deb" ) ;
58
58
59
59
let base_dir = settings. project_out_directory ( ) . join ( "bundle/deb" ) ;
60
60
let package_dir = base_dir. join ( & package_base_name) ;
61
61
if package_dir. exists ( ) {
62
62
fs:: remove_dir_all ( & package_dir)
63
- . with_context ( || format ! ( "Failed to remove old {}" , package_base_name ) ) ?;
63
+ . with_context ( || format ! ( "Failed to remove old {package_base_name}" ) ) ?;
64
64
}
65
65
let package_path = base_dir. join ( & package_name) ;
66
66
@@ -107,7 +107,7 @@ pub fn generate_data(
107
107
for bin in settings. binaries ( ) {
108
108
let bin_path = settings. binary_path ( bin) ;
109
109
common:: copy_file ( & bin_path, bin_dir. join ( bin. name ( ) ) )
110
- . with_context ( || format ! ( "Failed to copy binary from {:?}" , bin_path ) ) ?;
110
+ . with_context ( || format ! ( "Failed to copy binary from {bin_path :?}" ) ) ?;
111
111
}
112
112
113
113
copy_resource_files ( settings, & data_dir) . with_context ( || "Failed to copy resource files" ) ?;
@@ -137,11 +137,11 @@ fn generate_control_file(
137
137
let mut file = common:: create_file ( & dest_path) ?;
138
138
writeln ! ( file, "Package: {}" , AsKebabCase ( settings. product_name( ) ) ) ?;
139
139
writeln ! ( file, "Version: {}" , settings. version_string( ) ) ?;
140
- writeln ! ( file, "Architecture: {}" , arch ) ?;
140
+ writeln ! ( file, "Architecture: {arch}" ) ?;
141
141
// Installed-Size must be divided by 1024, see https://www.debian.org/doc/debian-policy/ch-controlfields.html#installed-size
142
142
writeln ! ( file, "Installed-Size: {}" , total_dir_size( data_dir) ? / 1024 ) ?;
143
143
let authors = settings. authors_comma_separated ( ) . unwrap_or_default ( ) ;
144
- writeln ! ( file, "Maintainer: {}" , authors ) ?;
144
+ writeln ! ( file, "Maintainer: {authors}" ) ?;
145
145
if !settings. homepage_url ( ) . is_empty ( ) {
146
146
writeln ! ( file, "Homepage: {}" , settings. homepage_url( ) ) ?;
147
147
}
@@ -157,13 +157,13 @@ fn generate_control_file(
157
157
if long_description. is_empty ( ) {
158
158
long_description = "(none)" ;
159
159
}
160
- writeln ! ( file, "Description: {}" , short_description ) ?;
160
+ writeln ! ( file, "Description: {short_description}" ) ?;
161
161
for line in long_description. lines ( ) {
162
162
let line = line. trim ( ) ;
163
163
if line. is_empty ( ) {
164
164
writeln ! ( file, " ." ) ?;
165
165
} else {
166
- writeln ! ( file, " {}" , line ) ?;
166
+ writeln ! ( file, " {line}" ) ?;
167
167
}
168
168
}
169
169
writeln ! ( file, "Priority: optional" ) ?;
@@ -186,14 +186,14 @@ fn generate_md5sums(control_dir: &Path, data_dir: &Path) -> crate::Result<()> {
186
186
let mut hash = md5:: Context :: new ( ) ;
187
187
io:: copy ( & mut file, & mut hash) ?;
188
188
for byte in hash. compute ( ) . iter ( ) {
189
- write ! ( md5sums_file, "{:02x}" , byte ) ?;
189
+ write ! ( md5sums_file, "{byte :02x}" ) ?;
190
190
}
191
191
let rel_path = path. strip_prefix ( data_dir) ?;
192
192
let path_str = rel_path. to_str ( ) . ok_or_else ( || {
193
- let msg = format ! ( "Non-UTF-8 path: {:?}" , rel_path ) ;
193
+ let msg = format ! ( "Non-UTF-8 path: {rel_path :?}" ) ;
194
194
io:: Error :: new ( io:: ErrorKind :: InvalidData , msg)
195
195
} ) ?;
196
- writeln ! ( md5sums_file, " {}" , path_str ) ?;
196
+ writeln ! ( md5sums_file, " {path_str}" ) ?;
197
197
}
198
198
Ok ( ( ) )
199
199
}
0 commit comments