Macro concat_with::concat

source ·
macro_rules! concat {
    ($(,)*) => { ... };
    ( $e:expr $(,)*) => { ... };
    ( $e:expr $(, $es:expr)+ $(,)*) => { ... };
    (with $w:expr $(,)*) => { ... };
    (with $w:expr, $e:expr $(,)*) => { ... };
    (with $w:expr, $e:expr $(, $es:expr)+ $(,)*) => { ... };
    (prefix $p:expr $(,)*) => { ... };
    (prefix $p:expr, $e:expr $(,)*) => { ... };
    (prefix $p:expr, $e:expr $(, $es:expr)+ $(,)*) => { ... };
    (suffix $s:expr $(,)*) => { ... };
    (suffix $s:expr, $e:expr $(,)*) => { ... };
    (suffix $s:expr, $e:expr $(, $es:expr)+ $(,)*) => { ... };
    (prefix $p:expr, suffix $s:expr $(,)*) => { ... };
    (prefix $p:expr, suffix $s:expr, $e:expr $(,)*) => { ... };
    (prefix $p:expr, suffix $s:expr, $e:expr $(, $es:expr)+ $(,)*) => { ... };
    (suffix $s:expr, prefix $p:expr $(,)*) => { ... };
    (suffix $s:expr, prefix $p:expr, $e:expr $(,)*) => { ... };
    (suffix $s:expr, prefix $p:expr, $e:expr $(, $es:expr)+ $(,)*) => { ... };
    (with $w:expr, prefix $p:expr $(,)*) => { ... };
    (with $w:expr, prefix $p:expr, $e:expr $(,)*) => { ... };
    (with $w:expr, prefix $p:expr, $e:expr $(, $es:expr)+ $(,)*) => { ... };
    (prefix $p:expr, with $w:expr $(,)*) => { ... };
    (prefix $p:expr, with $w:expr, $e:expr $(,)*) => { ... };
    (prefix $p:expr, with $w:expr, $e:expr $(, $es:expr)+ $(,)*) => { ... };
    (with $w:expr, suffix $s:expr $(,)*) => { ... };
    (with $w:expr, suffix $s:expr, $e:expr $(,)*) => { ... };
    (with $w:expr, suffix $s:expr, $e:expr $(, $es:expr)+ $(,)*) => { ... };
    (suffix $s:expr, with $w:expr $(,)*) => { ... };
    (suffix $s:expr, with $w:expr, $e:expr $(,)*) => { ... };
    (suffix $s:expr, with $w:expr, $e:expr $(, $es:expr)+ $(,)*) => { ... };
    (with $w:expr, prefix $p:expr, suffix $s:expr $(,)*) => { ... };
    (with $w:expr, prefix $p:expr, suffix $s:expr, $e:expr $(,)*) => { ... };
    (with $w:expr, prefix $p:expr, suffix $s:expr, $e:expr $(, $es:expr)+ $(,)*) => { ... };
    (prefix $p:expr, with $w:expr, suffix $s:expr $(,)*) => { ... };
    (prefix $p:expr, with $w:expr, suffix $s:expr, $e:expr $(,)*) => { ... };
    (prefix $p:expr, with $w:expr, suffix $s:expr, $e:expr $(, $es:expr)+ $(,)*) => { ... };
    (prefix $p:expr, suffix $s:expr, with $w:expr $(,)*) => { ... };
    (prefix $p:expr, suffix $s:expr, with $w:expr, $e:expr $(,)*) => { ... };
    (prefix $p:expr, suffix $s:expr, with $w:expr, $e:expr $(, $es:expr)+ $(,)*) => { ... };
    (with $w:expr, suffix $s:expr, prefix $p:expr $(,)*) => { ... };
    (with $w:expr, suffix $s:expr, prefix $p:expr, $e:expr $(,)*) => { ... };
    (with $w:expr, suffix $s:expr, prefix $p:expr, $e:expr $(, $es:expr)+ $(,)*) => { ... };
    (suffix $s:expr, with $w:expr, prefix $p:expr $(,)*) => { ... };
    (suffix $s:expr, with $w:expr, prefix $p:expr, $e:expr $(,)*) => { ... };
    (suffix $s:expr, with $w:expr, prefix $p:expr, $e:expr $(, $es:expr)+ $(,)*) => { ... };
    (suffix $s:expr, prefix $p:expr, with $w:expr $(,)*) => { ... };
    (suffix $s:expr, prefix $p:expr, with $w:expr, $e:expr $(,)*) => { ... };
    (suffix $s:expr, prefix $p:expr, with $w:expr, $e:expr $(, $es:expr)+ $(,)*) => { ... };
}
Expand description

Concatenates literals into a static string slice.

This macro is like the concat! macro in std, but can also be used to concatenate literals separated by a specific literal. Prefixes and suffixes can also be added.

assert_eq!("test10btrue", concat_with::concat!("test", 10, 'b', true));
assert_eq!("test, 10, b, true", concat_with::concat!(with ", ", "test", 10, 'b', true));
assert_eq!("test\n10\nb\ntrue", concat_with::concat_line!("test", 10, 'b', true));