diff --git a/Cargo.toml b/Cargo.toml index 432f892..bbdf9cc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ keywords = ["ros2", "colcon", "ament"] [dependencies] anyhow = "1" -cargo-manifest = "0.2" +cargo-manifest = "0.17" pico-args = "0.4" # The profile that 'cargo dist' will build with diff --git a/src/lib.rs b/src/lib.rs index 1d1c49d..091fef3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,7 @@ // Licensed under the Apache License, Version 2.0 use anyhow::{anyhow, bail, Context, Result}; -use cargo_manifest::{Manifest, Product, Value}; +use cargo_manifest::{Manifest, Product, StringOrBool, Value}; use std::ffi::OsString; use std::fs::{DirBuilder, File}; @@ -186,8 +186,8 @@ pub fn install_package( // The entry for the build script can be empty (in which case build.rs is implicitly used if it // exists), or a path, or false (in which case build.rs is not implicitly used). let build = match &package.build { - Some(Value::Boolean(false)) => None, - Some(Value::String(path)) => Some(path.as_str()), + Some(StringOrBool::Bool(false)) => None, + Some(StringOrBool::String(path)) => Some(path.as_str()), Some(_) => bail!("Value of 'build' is not a string or boolean"), None => None, }; @@ -306,9 +306,7 @@ pub fn install_files_from_metadata( for rel_path in install_entries { let src = package_path.as_ref().join(&rel_path); copy(&src, &dest).with_context(|| { - format!( - "Could not process [package.metadata.ros.{key}] entry '{rel_path}'", - ) + format!("Could not process [package.metadata.ros.{key}] entry '{rel_path}'",) })?; } } diff --git a/src/main.rs b/src/main.rs index 415d2b1..4d77afa 100644 --- a/src/main.rs +++ b/src/main.rs @@ -34,7 +34,7 @@ fn fallible_main() -> Result { // Unwrap is safe since complete_from_path() has been called let is_pure_library = { - let no_binaries = manifest.bin.as_ref().unwrap().is_empty(); + let no_binaries = manifest.bin.is_empty(); let no_exported_libraries = if let Some(crate_types) = manifest .lib .as_ref() @@ -79,7 +79,7 @@ fn fallible_main() -> Result { package_name, &args.profile, // Unwrap is safe since complete_from_path() has been called - &manifest.bin.unwrap(), + &manifest.bin, )?; install_files_from_metadata( &args.install_base,