@@ -864,7 +864,7 @@ impl AppSettings for RustAppSettings {
864
864
}
865
865
866
866
fn app_binary_path ( & self , options : & Options ) -> crate :: Result < PathBuf > {
867
- let binaries = self . get_binaries ( & self . target_triple ) ?;
867
+ let binaries = self . get_binaries ( ) ?;
868
868
let bin_name = binaries
869
869
. iter ( )
870
870
. find ( |x| x. main ( ) )
@@ -884,25 +884,22 @@ impl AppSettings for RustAppSettings {
884
884
Ok ( out_dir. join ( bin_name) . with_extension ( ext) )
885
885
}
886
886
887
- fn get_binaries ( & self , target : & str ) -> crate :: Result < Vec < BundleBinary > > {
887
+ fn get_binaries ( & self ) -> crate :: Result < Vec < BundleBinary > > {
888
888
let mut binaries: Vec < BundleBinary > = vec ! [ ] ;
889
889
890
- let ext = if target. contains ( "windows" ) {
891
- ".exe"
892
- } else {
893
- ""
894
- } ;
895
-
896
890
if let Some ( bins) = & self . cargo_settings . bin {
897
891
let default_run = self
898
892
. package_settings
899
893
. default_run
900
894
. clone ( )
901
895
. unwrap_or_default ( ) ;
902
896
for bin in bins {
903
- let name = format ! ( "{}{}" , bin. name, ext) ;
904
897
let is_main = bin. name == self . cargo_package_settings . name || bin. name == default_run;
905
- binaries. push ( BundleBinary :: with_path ( name, is_main, bin. path . clone ( ) ) )
898
+ binaries. push ( BundleBinary :: with_path (
899
+ bin. name . clone ( ) ,
900
+ is_main,
901
+ bin. path . clone ( ) ,
902
+ ) )
906
903
}
907
904
}
908
905
@@ -943,21 +940,21 @@ impl AppSettings for RustAppSettings {
943
940
. iter ( )
944
941
. any ( |bin| bin. name ( ) == name || path. ends_with ( bin. src_path ( ) . unwrap_or ( & "" . to_string ( ) ) ) ) ;
945
942
if !bin_exists {
946
- binaries. push ( BundleBinary :: new ( format ! ( "{ name}{ext}" ) , false ) )
943
+ binaries. push ( BundleBinary :: new ( name, false ) )
947
944
}
948
945
}
949
946
950
947
if let Some ( default_run) = self . package_settings . default_run . as_ref ( ) {
951
948
if let Some ( binary) = binaries. iter_mut ( ) . find ( |bin| bin. name ( ) == default_run) {
952
949
binary. set_main ( true ) ;
953
950
} else {
954
- binaries. push ( BundleBinary :: new ( format ! ( "{}{}" , default_run, ext ) , true ) ) ;
951
+ binaries. push ( BundleBinary :: new ( default_run. clone ( ) , true ) ) ;
955
952
}
956
953
}
957
954
958
955
match binaries. len ( ) {
959
956
0 => binaries. push ( BundleBinary :: new (
960
- format ! ( "{}{}" , self . cargo_package_settings. name, ext ) ,
957
+ self . cargo_package_settings . name . clone ( ) ,
961
958
true ,
962
959
) ) ,
963
960
1 => binaries. get_mut ( 0 ) . unwrap ( ) . set_main ( true ) ,
0 commit comments