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
If the identifier, type and const value do not fit within the right margin, move
the default value down one line first and indent it one step from the previous
line, following the rules of assignment operators in expressions.
If the identifier and type still don't fit within the right margin, pull the type
down and indent it one level. If the type and const value fit within the right
margin, keep them in a single line, otherwise pull the default value down one line
and indent it one step further.
Proposed addition to https://github.com/rust-lang/rust/blob/master/src/doc/style-guide/src/items.md#structs-and-unions to account for default field values:
If the struct has a const default field value, if the value is a single expression
it should be on the same line.
If the const value is a
const
block, it should follow the same rules as thevalue of
const
items, matching the field's indentation.If the identifier, type and const value do not fit within the right margin, move
the default value down one line first and indent it one step from the previous
line, following the rules of assignment operators in expressions.
If the identifier and type still don't fit within the right margin, pull the type
down and indent it one level. If the type and const value fit within the right
margin, keep them in a single line, otherwise pull the default value down one line
and indent it one step further.
The text was updated successfully, but these errors were encountered: