@@ -57,13 +57,13 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
5757 settings. version_string( ) ,
5858 arch
5959 ) ;
60- let package_name = format ! ( "{}.deb" , package_base_name ) ;
60+ let package_name = format ! ( "{package_base_name }.deb" ) ;
6161
6262 let base_dir = settings. project_out_directory ( ) . join ( "bundle/deb" ) ;
6363 let package_dir = base_dir. join ( & package_base_name) ;
6464 if package_dir. exists ( ) {
6565 fs:: remove_dir_all ( & package_dir)
66- . with_context ( || format ! ( "Failed to remove old {}" , package_base_name ) ) ?;
66+ . with_context ( || format ! ( "Failed to remove old {package_base_name}" ) ) ?;
6767 }
6868 let package_path = base_dir. join ( & package_name) ;
6969
@@ -110,7 +110,7 @@ pub fn generate_data(
110110 for bin in settings. binaries ( ) {
111111 let bin_path = settings. binary_path ( bin) ;
112112 common:: copy_file ( & bin_path, bin_dir. join ( bin. name ( ) ) )
113- . with_context ( || format ! ( "Failed to copy binary from {:?}" , bin_path ) ) ?;
113+ . with_context ( || format ! ( "Failed to copy binary from {bin_path :?}" ) ) ?;
114114 }
115115
116116 copy_resource_files ( settings, & data_dir) . with_context ( || "Failed to copy resource files" ) ?;
@@ -135,7 +135,7 @@ fn generate_changelog_file(settings: &Settings, data_dir: &Path) -> crate::Resul
135135 if let Some ( changelog_src_path) = & settings. deb ( ) . changelog {
136136 let mut src_file = File :: open ( changelog_src_path) ?;
137137 let bin_name = settings. main_binary_name ( ) ;
138- let dest_path = data_dir. join ( format ! ( "usr/share/doc/{}/changelog.gz" , bin_name ) ) ;
138+ let dest_path = data_dir. join ( format ! ( "usr/share/doc/{bin_name }/changelog.gz" ) ) ;
139139
140140 let changelog_file = common:: create_file ( & dest_path) ?;
141141 let mut gzip_encoder = GzEncoder :: new ( changelog_file, Compression :: new ( 9 ) ) ;
@@ -160,16 +160,16 @@ fn generate_control_file(
160160 let mut file = common:: create_file ( & dest_path) ?;
161161 writeln ! ( file, "Package: {}" , AsKebabCase ( settings. product_name( ) ) ) ?;
162162 writeln ! ( file, "Version: {}" , settings. version_string( ) ) ?;
163- writeln ! ( file, "Architecture: {}" , arch ) ?;
163+ writeln ! ( file, "Architecture: {arch}" ) ?;
164164 // Installed-Size must be divided by 1024, see https://www.debian.org/doc/debian-policy/ch-controlfields.html#installed-size
165165 writeln ! ( file, "Installed-Size: {}" , total_dir_size( data_dir) ? / 1024 ) ?;
166166 let authors = settings. authors_comma_separated ( ) . unwrap_or_default ( ) ;
167- writeln ! ( file, "Maintainer: {}" , authors ) ?;
167+ writeln ! ( file, "Maintainer: {authors}" ) ?;
168168 if let Some ( section) = & settings. deb ( ) . section {
169- writeln ! ( file, "Section: {}" , section ) ?;
169+ writeln ! ( file, "Section: {section}" ) ?;
170170 }
171171 if let Some ( priority) = & settings. deb ( ) . priority {
172- writeln ! ( file, "Priority: {}" , priority ) ?;
172+ writeln ! ( file, "Priority: {priority}" ) ?;
173173 } else {
174174 writeln ! ( file, "Priority: optional" ) ?;
175175 }
@@ -215,13 +215,13 @@ fn generate_control_file(
215215 if long_description. is_empty ( ) {
216216 long_description = "(none)" ;
217217 }
218- writeln ! ( file, "Description: {}" , short_description ) ?;
218+ writeln ! ( file, "Description: {short_description}" ) ?;
219219 for line in long_description. lines ( ) {
220220 let line = line. trim ( ) ;
221221 if line. is_empty ( ) {
222222 writeln ! ( file, " ." ) ?;
223223 } else {
224- writeln ! ( file, " {}" , line ) ?;
224+ writeln ! ( file, " {line}" ) ?;
225225 }
226226 }
227227 file. flush ( ) ?;
@@ -243,14 +243,14 @@ fn generate_md5sums(control_dir: &Path, data_dir: &Path) -> crate::Result<()> {
243243 let mut hash = md5:: Context :: new ( ) ;
244244 io:: copy ( & mut file, & mut hash) ?;
245245 for byte in hash. compute ( ) . iter ( ) {
246- write ! ( md5sums_file, "{:02x}" , byte ) ?;
246+ write ! ( md5sums_file, "{byte :02x}" ) ?;
247247 }
248248 let rel_path = path. strip_prefix ( data_dir) ?;
249249 let path_str = rel_path. to_str ( ) . ok_or_else ( || {
250- let msg = format ! ( "Non-UTF-8 path: {:?}" , rel_path ) ;
250+ let msg = format ! ( "Non-UTF-8 path: {rel_path :?}" ) ;
251251 io:: Error :: new ( io:: ErrorKind :: InvalidData , msg)
252252 } ) ?;
253- writeln ! ( md5sums_file, " {}" , path_str ) ?;
253+ writeln ! ( md5sums_file, " {path_str}" ) ?;
254254 }
255255 Ok ( ( ) )
256256}
0 commit comments