IssueRaiser

Gives up on chains if any line is too long.

If there is a method call chain, and just one call exceeds max_width, it seems like rustfmt gives up and doesn't format anything. Example: ```rust fn f() { foo("This text is under the max_width limit, and shouldn't cause any problems on its own.").long("But this line is extra long, and doesn't fit within 100 max_width. 1234567890123456789").baz().collect().unwrap(); } ``` No format changes will be applied to this. I'm also a bit surprised that `error_on_line_overflow` does not complain. I would expect it to wrap each call chain element, even if one of them is too long, such as: ```rust fn f() { foo("This text is under the max_width limit, and shouldn't cause any problems on its own.") .long("But this line is extra long, and doesn't fit within 100 max_width. 1234567890123456789") .baz() .collect() .unwrap(); } ``` All default settings. rustfmt 1.4.8-nightly (afb1ee1c 2019-09-08)

Posted by ehuss on Oct 14, 2019, 9:07 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.3,500 issues0 comments

github (Other)

Gives up on chains if any line is too long.

ehussOct 14, 2019, 9:07 PM

If there is a method call chain, and just one call exceeds max_width, it seems like rustfmt gives up and doesn't format anything. Example: ```rust fn f() { foo("This text is under the max_width limit, and shouldn't cause any problems on its own.").long("But this line is extra long, and doesn't fit within 100 max_width. 1234567890123456789").baz().collect().unwrap(); } ``` No format changes will be applied to this. I'm also a bit surprised that `error_on_line_overflow` does not complain. I would expect it to wrap each call chain element, even if one of them is too long, such as: ```rust fn f() { foo("This text is under the max_width limit, and shouldn't cause any problems on its own.") .long("But this line is extra long, and doesn't fit within 100 max_width. 1234567890123456789") .baz() .collect() .unwrap(); } ``` All default settings. rustfmt 1.4.8-nightly (afb1ee1c 2019-09-08)

Comments (0)

No comments yet. Start the discussion.

Comment on this issue