@@ -65,15 +65,11 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
6565
6666 if app_bundle_path. exists ( ) {
6767 fs:: remove_dir_all ( & app_bundle_path)
68- . with_context ( || format ! ( "Failed to remove old {}" , app_product_name ) ) ?;
68+ . with_context ( || format ! ( "Failed to remove old {app_product_name}" ) ) ?;
6969 }
7070 let bundle_directory = app_bundle_path. join ( "Contents" ) ;
71- fs:: create_dir_all ( & bundle_directory) . with_context ( || {
72- format ! (
73- "Failed to create bundle directory at {:?}" ,
74- bundle_directory
75- )
76- } ) ?;
71+ fs:: create_dir_all ( & bundle_directory)
72+ . with_context ( || format ! ( "Failed to create bundle directory at {bundle_directory:?}" ) ) ?;
7773
7874 let resources_dir = bundle_directory. join ( "Resources" ) ;
7975 let bin_dir = bundle_directory. join ( "MacOS" ) ;
@@ -160,7 +156,7 @@ fn copy_binaries_to_bundle(
160156 let bin_path = settings. binary_path ( bin) ;
161157 let dest_path = dest_dir. join ( bin. name ( ) ) ;
162158 fs_utils:: copy_file ( & bin_path, & dest_path)
163- . with_context ( || format ! ( "Failed to copy binary from {:?}" , bin_path ) ) ?;
159+ . with_context ( || format ! ( "Failed to copy binary from {bin_path :?}" ) ) ?;
164160 paths. push ( dest_path) ;
165161 }
166162 Ok ( paths)
@@ -176,10 +172,10 @@ fn copy_custom_files_to_bundle(bundle_directory: &Path, settings: &Settings) ->
176172 } ;
177173 if path. is_file ( ) {
178174 fs_utils:: copy_file ( path, & bundle_directory. join ( contents_path) )
179- . with_context ( || format ! ( "Failed to copy file {:?} to {:?}" , path , contents_path ) ) ?;
175+ . with_context ( || format ! ( "Failed to copy file {path :?} to {contents_path :?}" ) ) ?;
180176 } else {
181177 fs_utils:: copy_dir ( path, & bundle_directory. join ( contents_path) )
182- . with_context ( || format ! ( "Failed to copy directory {:?} to {:?}" , path , contents_path ) ) ?;
178+ . with_context ( || format ! ( "Failed to copy directory {path :?} to {contents_path :?}" ) ) ?;
183179 }
184180 }
185181 Ok ( ( ) )
@@ -359,7 +355,7 @@ fn create_info_plist(
359355
360356// Copies the framework under `{src_dir}/{framework}.framework` to `{dest_dir}/{framework}.framework`.
361357fn copy_framework_from ( dest_dir : & Path , framework : & str , src_dir : & Path ) -> crate :: Result < bool > {
362- let src_name = format ! ( "{}.framework" , framework ) ;
358+ let src_name = format ! ( "{framework }.framework" ) ;
363359 let src_path = src_dir. join ( & src_name) ;
364360 if src_path. exists ( ) {
365361 fs_utils:: copy_dir ( & src_path, & dest_dir. join ( & src_name) ) ?;
@@ -387,7 +383,7 @@ fn copy_frameworks_to_bundle(
387383 }
388384 let dest_dir = bundle_directory. join ( "Frameworks" ) ;
389385 fs:: create_dir_all ( bundle_directory)
390- . with_context ( || format ! ( "Failed to create Frameworks directory at {:?}" , dest_dir ) ) ?;
386+ . with_context ( || format ! ( "Failed to create Frameworks directory at {dest_dir :?}" ) ) ?;
391387 for framework in frameworks. iter ( ) {
392388 if framework. ends_with ( ".framework" ) {
393389 let src_path = PathBuf :: from ( framework) ;
@@ -402,8 +398,7 @@ fn copy_frameworks_to_bundle(
402398 let src_path = PathBuf :: from ( framework) ;
403399 if !src_path. exists ( ) {
404400 return Err ( crate :: Error :: GenericError ( format ! (
405- "Library not found: {}" ,
406- framework
401+ "Library not found: {framework}"
407402 ) ) ) ;
408403 }
409404 let src_name = src_path. file_name ( ) . expect ( "Couldn't get library filename" ) ;
@@ -416,8 +411,7 @@ fn copy_frameworks_to_bundle(
416411 continue ;
417412 } else if framework. contains ( '/' ) {
418413 return Err ( crate :: Error :: GenericError ( format ! (
419- "Framework path should have .framework extension: {}" ,
420- framework
414+ "Framework path should have .framework extension: {framework}"
421415 ) ) ) ;
422416 }
423417 if let Some ( home_dir) = dirs:: home_dir ( ) {
@@ -435,8 +429,7 @@ fn copy_frameworks_to_bundle(
435429 continue ;
436430 }
437431 return Err ( crate :: Error :: GenericError ( format ! (
438- "Could not locate framework: {}" ,
439- framework
432+ "Could not locate framework: {framework}"
440433 ) ) ) ;
441434 }
442435 Ok ( paths)
0 commit comments