-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't work correctly with new Rust inline formatting #96
Comments
Seems like an easy fix - should i submit a PR? |
Ah, turns out its already been fixed, but has not been released yet. Thx for all the hard work updating it. Can't wait for the new release! |
Oh, it was? Where did you see that? |
TBH, the implementation seems a bit convoluted, but I might simply not know enough about it. Most implementations I have seen simply rely on macro_rules! foo {
($($arg:tt)+) => {
format_args!($($arg)+)
};
} |
I don't understand how the referenced lines are related to feature in question. |
They are used Lines 1231 to 1234 in 0b24ae5
eyre/eyre/tests/test_macros.rs Lines 78 to 85 in 0b24ae5
|
Looks like this was released, so closing. |
Nowadays Rust supports inline formatting for variables like
format!("Expected {a} to be {b}")
.This syntax works correctly in
format!
,format_args!
,anyhow!
and a lot of other contexts.However, in eyre, somewhat surprisingly, it treats the string as a literal and prints without interpolation, even though eyre itself has support for formatting when arguments are passed explicitly. It seems this stems from all macros (
ensure!
,bail!
,eyre!
) having a separate branch that catches string literal with no following arguments in a special way:The text was updated successfully, but these errors were encountered: