From d319e7afb4cc1fd8cc5280f526f92117921c868d Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 16 Jul 2023 13:43:29 -0700 Subject: [PATCH] Delete cargo metadata fail warning --- src/main.rs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/main.rs b/src/main.rs index ff96094..283d0e8 100644 --- a/src/main.rs +++ b/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); - } } }