Skip to content

Commit c443e1e

Browse files
authored
fix: don't hard code a *nix path separator (#27)
* fix: don't hard code a *nix path separator * Fix a new cargo clippy lint
1 parent f32ea6d commit c443e1e

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

rosidl_runtime_rs/build.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
cfg_if::cfg_if! {
22
if #[cfg(not(feature="use_ros_shim"))] {
33
use std::env;
4-
use std::path::Path;
54

65
const AMENT_PREFIX_PATH: &str = "AMENT_PREFIX_PATH";
76

@@ -22,8 +21,8 @@ fn main() {
2221
#[cfg(not(feature = "use_ros_shim"))]
2322
{
2423
let ament_prefix_path_list = get_env_var_or_abort(AMENT_PREFIX_PATH);
25-
for ament_prefix_path in ament_prefix_path_list.split(':') {
26-
let library_path = Path::new(ament_prefix_path).join("lib");
24+
for ament_prefix_path in env::split_paths(&ament_prefix_path_list) {
25+
let library_path = ament_prefix_path.join("lib");
2726
println!("cargo:rustc-link-search=native={}", library_path.display());
2827
}
2928
}

0 commit comments

Comments
 (0)