Open
Description
Rustfmt accepts the following code without issues:
pub const FOO: &str = foo("
foo
bar
");
But if we are to replace foo
with a function-like macro:
pub const FOO: &str = foo!("
foo
bar
");
Rustfmt wants to reformat it as:
pub const FOO: &str = foo!(
"
foo
bar
"
);
The resulting formatting is far from beautiful, space inefficient, and inconsistent with how rustfmt handles functions.
This issue is quite annoying in practice for example when code uses the hex-literal
crate.