Macro trail::trail [] [src]

macro_rules! trail {
    ( $($segment:expr),* ) => { ... };
}

A macro for building a cross-platform Path at compile time.

Example

let absolute = &trail!("", "hello", "world");
let relative = &trail!("hello", "world");

if cfg!(windows) {
    assert_eq!(*absolute, Path::new("\\hello\\world"));
    assert_eq!(*relative, Path::new("hello\\world"));
} else {
    assert_eq!(*absolute, Path::new("/hello/world"));
    assert_eq!(*relative, Path::new("hello/world"));
}