Skip to content
This repository has been archived by the owner. It is now read-only.

Indent 2 levels for line continuations #20

Closed
superlukas opened this Issue Jul 12, 2014 · 1 comment

Comments

Projects
None yet
2 participants
@superlukas
Copy link

superlukas commented Jul 12, 2014

I'm talking about this guy:

// this
frobnicate(
    arg1,
    arg2,
    arg3);

// becomes this
frobnicate(arg1, arg2,
        arg3, arg4);

Another example:

let really_really_really_long_name =
        "really really really long value tooooooooooooooooo";

That's how Clang-Format does it anyway ...

Edit: The reason I like and use this style is that it visually sets apart continuations from blocks.

I'm talking about this file.

@lilyball

This comment has been minimized.

Copy link
Contributor

lilyball commented Jul 17, 2014

The indentation shown in that file, where values are wrapped to the level of their containing delimiters (e.g. args to the argument list) is pretty universal in my experience reading Rust code. It also aids in readability, because it makes it immediately obvious what the "scope" the line continuation is inside.

I could see an argument to be made for a 2-level indentation when the line continuation doesn't have a "scope", e.g. your example of really_really_really_long_name.

@superlukas superlukas closed this Aug 30, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.