You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
assert!(
self.value_type_str(),
"key \"{}\" does not refer to a string",
a
);
Clippy suggest to write it as:
assert!(
self.value_type_str(),
"{}",
"key \"{a}\" does not refer to a string"
);
To me, the second one is quite confusing as it inline formatting but requires additional {} format arg. I suppose this is due to the implementation of assert macro, but it's really not better than the first one.
Should be fixed by #10055, it's a bug that panic/assert macros were linted in code that isn't using the 2021 edition, which then caused the rustc non_fmt_panics lint to fire
Description
Consider following:
Clippy suggest to write it as:
To me, the second one is quite confusing as it inline formatting but requires additional
{}
format arg. I suppose this is due to the implementation ofassert
macro, but it's really not better than the first one.Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: