I want a macro, that joins some static strings with a separator, so that
expected!("a", "b", "c")
becomes
"a or b or c"
My current approach
macro_rules! expected {
( $( $value:expr ),*) => {
concat!( $($value, " or ",),*)
}
}
which expands to
"a or b or c or "
Is there any way to remove the trailing or
without converting it to a String, so the macro expands to
"a or b or c"
?
please note that this post has been written on mobile and therefore the examples might be invalid.