-
Notifications
You must be signed in to change notification settings - Fork 840
Description
Over the past two years, the style team has settled on a Rust style that uses exclusively four-space indentation
Each level of indentation must be four spaces (that is, all indentation
outside of string literals and comments must be a multiple of four).
and discourages any form of "visual" alignment meaning whitespace within a line to align tokens on vertical column boundaries. Please find the complete formatting guidelines RFC in rust-lang/rfcs#2436.
I find that the heavily visually aligned style in nom's documentation looks very out of place in modern Rust code formatted according to the style team guidelines. Notice the two-space indentation, the one line indented by 11 spaces to achieve visual alignment, and the visual alignment of the hex_primary and >> tokens in the following snippet from the readme.
named!(hex_color<&str, Color>,
do_parse!(
tag!("#") >>
red: hex_primary >>
green: hex_primary >>
blue: hex_primary >>
(Color { red, green, blue })
)
);It would be valuable to redesign how we intend for nom macro invocations to be formatted in modern Rust code, adjusting the input syntax of macros as necessary to arrive at a style that is harmonious with the one being pushed by the style team.