Macro pathbuf

Source
macro_rules! pathbuf {
    ( $( $part:expr ),* ) => { ... };
    ($( $part:expr, )*) => { ... };
}
Expand description

Creates a PathBuf containing the arguments.

pathbuf! allows PathBufs to be defined with the same syntax as array expressions, like so:

fn do_something(dir: &Path) {
    let file_name = pathbuf![dir, "filename.txt"];

    if file_name.exists() {
        // do something...
    }
}