|
@@ -188,17 +188,19 @@ impl CrateConfig {
|
|
|
|
|
|
let output_filename = {
|
|
let output_filename = {
|
|
match &manifest.package.as_ref().unwrap().default_run {
|
|
match &manifest.package.as_ref().unwrap().default_run {
|
|
- Some(default_run_target) => {
|
|
|
|
- default_run_target.to_owned()
|
|
|
|
- },
|
|
|
|
- None => {
|
|
|
|
- manifest.bin.iter().find(|b| b.name == manifest.package.as_ref().map(|pkg| pkg.name.clone()))
|
|
|
|
- .or(manifest.bin.iter().find(|b| b.path == Some("src/main.rs".to_owned())))
|
|
|
|
- .or(manifest.bin.first())
|
|
|
|
- .or(manifest.lib.as_ref())
|
|
|
|
- .and_then(|prod| prod.name.clone())
|
|
|
|
- .expect("No executable or library found from cargo metadata.")
|
|
|
|
- }
|
|
|
|
|
|
+ Some(default_run_target) => default_run_target.to_owned(),
|
|
|
|
+ None => manifest
|
|
|
|
+ .bin
|
|
|
|
+ .iter()
|
|
|
|
+ .find(|b| b.name == manifest.package.as_ref().map(|pkg| pkg.name.clone()))
|
|
|
|
+ .or(manifest
|
|
|
|
+ .bin
|
|
|
|
+ .iter()
|
|
|
|
+ .find(|b| b.path == Some("src/main.rs".to_owned())))
|
|
|
|
+ .or(manifest.bin.first())
|
|
|
|
+ .or(manifest.lib.as_ref())
|
|
|
|
+ .and_then(|prod| prod.name.clone())
|
|
|
|
+ .expect("No executable or library found from cargo metadata."),
|
|
}
|
|
}
|
|
};
|
|
};
|
|
let executable = ExecutableType::Binary(output_filename);
|
|
let executable = ExecutableType::Binary(output_filename);
|