macro_rules! join_path {
() => { ... };
(/) => { ... };
(/ $($s:expr),*) => { ... };
($first:expr) => { ... };
($first:expr, $( $s:expr ),*) => { ... };
}
Expand description
Join a path with the correct path separator
Examples
Join a relative path of three args
assert_eq!(join_path!("src","def","impl"),
concat!("src", path_separator!(), "def", path_separator!(), "impl"));
Make the path absolute by prepending a /
assert_eq!(join_path!(/ "var","tmp"),
concat!(path_separator!(), "var", path_separator!(), "tmp"));