File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -99,12 +99,15 @@ fn panic(_: &core::panic::PanicInfo) -> ! {
9999 let parsed_manifest =
100100 cargo_manifest:: Manifest :: from_slice ( manifest. contents . as_bytes ( ) ) ?;
101101
102+ let package_name = parsed_manifest. package . as_ref ( ) . map ( |v| & v. name ) ;
102103 // Create dummy entrypoint files for all binaries
103104 for bin in & parsed_manifest. bin . unwrap_or_default ( ) {
104105 // Relative to the manifest path
105106 let binary_relative_path = bin. path . to_owned ( ) . unwrap_or_else ( || match & bin. name {
106- Some ( name) => format ! ( "src/bin/{}.rs" , name) ,
107- None => "src/main.rs" . to_owned ( ) ,
107+ Some ( name) if Some ( name) != package_name => {
108+ format ! ( "src/bin/{}.rs" , name)
109+ }
110+ _ => "src/main.rs" . to_owned ( ) ,
108111 } ) ;
109112 let binary_path = parent_directory. join ( binary_relative_path) ;
110113 if let Some ( parent_directory) = binary_path. parent ( ) {
You can’t perform that action at this time.
0 commit comments