Skip to content

Commit 3d8109c

Browse files
skrobchikesteve
authored andcommitted
Update cargo-manifest
1 parent 88ba986 commit 3d8109c

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ keywords = ["ros2", "colcon", "ament"]
1414

1515
[dependencies]
1616
anyhow = "1"
17-
cargo-manifest = "0.2"
17+
cargo-manifest = "0.17"
1818
pico-args = "0.4"
1919

2020
# The profile that 'cargo dist' will build with

src/lib.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Licensed under the Apache License, Version 2.0
22

33
use anyhow::{anyhow, bail, Context, Result};
4-
use cargo_manifest::{Manifest, Product, Value};
4+
use cargo_manifest::{Manifest, Product, StringOrBool, Value};
55

66
use std::ffi::OsString;
77
use std::fs::{DirBuilder, File};
@@ -186,8 +186,8 @@ pub fn install_package(
186186
// The entry for the build script can be empty (in which case build.rs is implicitly used if it
187187
// exists), or a path, or false (in which case build.rs is not implicitly used).
188188
let build = match &package.build {
189-
Some(Value::Boolean(false)) => None,
190-
Some(Value::String(path)) => Some(path.as_str()),
189+
Some(StringOrBool::Bool(false)) => None,
190+
Some(StringOrBool::String(path)) => Some(path.as_str()),
191191
Some(_) => bail!("Value of 'build' is not a string or boolean"),
192192
None => None,
193193
};
@@ -306,9 +306,7 @@ pub fn install_files_from_metadata(
306306
for rel_path in install_entries {
307307
let src = package_path.as_ref().join(&rel_path);
308308
copy(&src, &dest).with_context(|| {
309-
format!(
310-
"Could not process [package.metadata.ros.{key}] entry '{rel_path}'",
311-
)
309+
format!("Could not process [package.metadata.ros.{key}] entry '{rel_path}'",)
312310
})?;
313311
}
314312
}

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ fn fallible_main() -> Result<bool> {
3434

3535
// Unwrap is safe since complete_from_path() has been called
3636
let is_pure_library = {
37-
let no_binaries = manifest.bin.as_ref().unwrap().is_empty();
37+
let no_binaries = manifest.bin.is_empty();
3838
let no_exported_libraries = if let Some(crate_types) = manifest
3939
.lib
4040
.as_ref()
@@ -79,7 +79,7 @@ fn fallible_main() -> Result<bool> {
7979
package_name,
8080
&args.profile,
8181
// Unwrap is safe since complete_from_path() has been called
82-
&manifest.bin.unwrap(),
82+
&manifest.bin,
8383
)?;
8484
install_files_from_metadata(
8585
&args.install_base,

0 commit comments

Comments
 (0)