Skip to content

Instantly share code, notes, and snippets.

@malobre
Last active January 9, 2025 21:02
Show Gist options
  • Save malobre/e7069ef6705aa863aad73bf9bf6e77ee to your computer and use it in GitHub Desktop.
Save malobre/e7069ef6705aa863aad73bf9bf6e77ee to your computer and use it in GitHub Desktop.
A macro to join strings with newlines
/// Flattens literals into a single static string slice, placing a newline between each element.
macro_rules! joinln {
($head:expr, $($e:expr),* $(,)?) => {
concat!($head, $('\n', $e, )*)
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment