Macro concat_with::concat_impl
source · macro_rules! concat_impl { (@inner $(#[$attr:meta])* $name:ident, $w: expr, $dollar:tt) => { ... }; ($($(#[$attr:meta])* $name:ident => $w:expr),* $(,) *) => { ... }; }
Expand description
Create macros used for concatenating literals separated by a specific literal.
concat_with::concat_impl! {
#[macro_export]
/// Concatenates literals into a static string slice separated by a comma and a whitespace, `, `. Prefixes and suffixes can also be added.
concat_with_comma => ", ",
#[macro_export]
/// Concatenates literals into a static string slice separated by a colon, `:`. Prefixes and suffixes can also be added.
concat_with_colon => ':',
}
assert_eq!("test, 10, b, true", concat_with_comma!("test", 10, 'b', true));
assert_eq!("test:10:b:true", concat_with_colon!("test", 10, 'b', true));