mirror of
https://github.com/dtolnay/cargo-expand.git
synced 2025-04-03 12:57:38 +03:00
Delete cargo metadata fail warning
This commit is contained in:
parent
8d8139502b
commit
d319e7afb4
1 changed files with 5 additions and 10 deletions
15
src/main.rs
15
src/main.rs
|
@ -313,18 +313,13 @@ fn apply_args(cmd: &mut Command, args: &Expand, color: &Coloring, outfile: &Path
|
|||
}
|
||||
|
||||
if !has_explicit_build_target {
|
||||
match cargo_metadata(args.manifest_path.as_deref()) {
|
||||
Ok(cargo_metadata) => {
|
||||
if let Some(root_package) = cargo_metadata.root_package() {
|
||||
if let Some(default_run) = &root_package.default_run {
|
||||
line.arg("--bin");
|
||||
line.arg(default_run);
|
||||
}
|
||||
if let Ok(cargo_metadata) = cargo_metadata(args.manifest_path.as_deref()) {
|
||||
if let Some(root_package) = cargo_metadata.root_package() {
|
||||
if let Some(default_run) = &root_package.default_run {
|
||||
line.arg("--bin");
|
||||
line.arg(default_run);
|
||||
}
|
||||
}
|
||||
Err(err) => {
|
||||
let _ = writeln!(io::stderr(), "WARNING: run cargo metadata fail: {}", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue