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
Unless struct patterns contain only shorthand variables, they seem to almost always split across multiple lines -- I find this a bit over-eager. For example:
which seems unnecessary. I tend to use a lot of struct unpacking like that as a way to ensure that if new fields are added I will get compliation errors. Spreading things across multiple lines here makes my code quite spread out vertically.
Sorry if I'm duplicating things! I did a brief search over the issues and didn't find an obvious duplicate.
Version: 0.2.8-nightly ( )
Configuration: None
The text was updated successfully, but these errors were encountered:
nikomatsakis
changed the title
struct patterns are awfully eager to split across lines in the default configuration
struct patterns eagerly split across lines in the default configuration
Oct 16, 2017
Whether to put struct/variant literals and patterns in a single line is controlled by struct_lit_width and struct_variant_width. Their default values are 18 and 35. You could set higher values to allow longer patterns to stay on the same line. We probably should make the default larger, and that is likely to be discussed in #1974.
Unless struct patterns contain only shorthand variables, they seem to almost always split across multiple lines -- I find this a bit over-eager. For example:
formats to:
which seems unnecessary. I tend to use a lot of struct unpacking like that as a way to ensure that if new fields are added I will get compliation errors. Spreading things across multiple lines here makes my code quite spread out vertically.
Sorry if I'm duplicating things! I did a brief search over the issues and didn't find an obvious duplicate.
Version: 0.2.8-nightly ( )
Configuration: None
The text was updated successfully, but these errors were encountered: