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
When the user attempts to use {}, {:?} or similar invocations, we should expect them to actually have a value. Warn the user when no value is provided and "{}" or the like would actually be printed.
The problem here, as I understand it, is that expect takes a &str, not a format string. So you actually couldn't supply a value.
In my opinion, a lint should be added for &str literals which include format-string syntax (like {:?}) to make sure the user actually intended the literal string "{:?}" or whether they thought they were in a format string and forgot a value.
Hopefully it's clear what I mean...
Edit: consider -- if a value was supposed to be provided, then it would be a compile fail, rather than something for the linter
What it does
When the user attempts to use
{}
,{:?}
or similar invocations, we should expect them to actually have a value. Warn the user when no value is provided and "{}" or the like would actually be printed.Inspired by bevyengine/bevy#16228
Advantage
These errors are likely an oversight, and they should either be removed or the correct value added.
Drawbacks
It will make it harder to draw strange ASCII faces in your error messages.
Example
Could be written as:
The text was updated successfully, but these errors were encountered: