Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 4 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down Expand Up @@ -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,
};
Expand Down Expand Up @@ -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}'",)
})?;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fn fallible_main() -> Result<bool> {

// 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()
Expand Down Expand Up @@ -79,7 +79,7 @@ fn fallible_main() -> Result<bool> {
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,
Expand Down