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
Currently, if one wants to print a number (or any other non-string value), one has to use println!("{}", 1234), which is a tad unwieldy. println!(1234) throws an error (one-argument invocations only work with strings). It's also annoying to write during debugging.
Why not overload the macros so that println!(expr) is an alias for println!("{}", expr)? This won't break any current behavior, but it will turn an error into something useful.
I have a possible fix on this branch, though eddyb suggested I try to make the changes in format_args! itself. (I'm not so familiar with that code, so I'd prefer to get feedback here before working on that.)
The text was updated successfully, but these errors were encountered:
…=Alexendoo
Check for needless raw strings in `format_args!()` template as well
changelog: [`needless_raw_strings`, `needless_raw_string_hashes`]: check `format_args!()` template as well
Fixrust-lang#13503
Currently, if one wants to print a number (or any other non-string value), one has to use
println!("{}", 1234)
, which is a tad unwieldy.println!(1234)
throws an error (one-argument invocations only work with strings). It's also annoying to write during debugging.Why not overload the macros so that
println!(expr)
is an alias forprintln!("{}", expr)
? This won't break any current behavior, but it will turn an error into something useful.I have a possible fix on this branch, though eddyb suggested I try to make the changes in
format_args!
itself. (I'm not so familiar with that code, so I'd prefer to get feedback here before working on that.)The text was updated successfully, but these errors were encountered: