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
fnmain(){
this.wrap(1+1,|| match msg {() => {"comment me out xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";let x =1+1;}})}
Here, the literal is very long, and theer's little rustfmt can do with it, which is expected. However, it seems that it also prevetns surrounding code from being reformatted (eg, spaces around +), and that seems like a bug.
In the real-world use-case, the long experssion is a tracing::info! call, which is a part of a hundred-lines long match, and rustfmt effectively doesn't work for the whole match expressions.
The text was updated successfully, but these errors were encountered:
Thanks for the link. I'm going to close this as a duplicate, but For what it's worth, I took a look at the snippet and these are the lines that are too long:
Length with indentation
Line
129
info!(target: "adversary", "Producing {} block out of {}, height = {}", blocks_produced, num_blocks, height);
102
// timeout is set to 1.5 seconds to give some room as we wait in Nightly for 2 seconds
115
info!(target: "adversary", "Check Storage Consistency, timeout set to {:?} milliseconds", timeout);
chances are if we special cased formatting for tracing macros (related to #5516), we should be able to format the snippet since each macro call would likely be split over multiple lines.
Consider this snippet:
Here, the literal is very long, and theer's little rustfmt can do with it, which is expected. However, it seems that it also prevetns surrounding code from being reformatted (eg, spaces around
+
), and that seems like a bug.In the real-world use-case, the long experssion is a
tracing::info!
call, which is a part of a hundred-lines longmatch
, and rustfmt effectively doesn't work for the whole match expressions.The text was updated successfully, but these errors were encountered: