os_str_cat

Macro os_str_cat 

Source
macro_rules! os_str_cat {
    (@stack $input:ident, $additional:ident; $($values_coerced:ident)*;) => { ... };
    (@stack $input:ident, $additional:ident; $($values_coerced:ident)*; $head:expr, $($tail:expr,)*) => { ... };
    ($input:expr; $($el:expr),+ $(,)?) => { ... };
    ($($el:expr),+ $(,)?) => { ... };
}
Expand description

Concatenate OS strings for a OsString.

It requires all elements to implement AsRef<OsStr>.

ยงExample

use str_cat::os_str_cat;
use std::ffi::OsStr;
use std::path::Path;

let mut s = os_str_cat!("Hello", " ".to_owned(), Path::new("World"), OsStr::new("!"));
assert_eq!(s, OsStr::new("Hello World!"));

// Reusing allocation.
s.clear();
os_str_cat!(&mut s; "foo", "bar");
assert_eq!(s, OsStr::new("foobar"));