Skip to content

Commit 4e04e82

Browse files
committed
Use the right kind of doc comment in chains.rs
cc #2185
1 parent 3c4d260 commit 4e04e82

File tree

1 file changed

+50
-50
lines changed

1 file changed

+50
-50
lines changed

src/chains.rs

+50-50
Original file line numberDiff line numberDiff line change
@@ -8,56 +8,56 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
/// Formatting of chained expressions, i.e. expressions which are chained by
12-
/// dots: struct and enum field access, method calls, and try shorthand (?).
13-
///
14-
/// Instead of walking these subexpressions one-by-one, as is our usual strategy
15-
/// for expression formatting, we collect maximal sequences of these expressions
16-
/// and handle them simultaneously.
17-
///
18-
/// Whenever possible, the entire chain is put on a single line. If that fails,
19-
/// we put each subexpression on a separate, much like the (default) function
20-
/// argument function argument strategy.
21-
///
22-
/// Depends on config options: `chain_indent` is the indent to use for
23-
/// blocks in the parent/root/base of the chain (and the rest of the chain's
24-
/// alignment).
25-
/// E.g., `let foo = { aaaa; bbb; ccc }.bar.baz();`, we would layout for the
26-
/// following values of `chain_indent`:
27-
/// Block:
28-
/// ```
29-
/// let foo = {
30-
/// aaaa;
31-
/// bbb;
32-
/// ccc
33-
/// }.bar
34-
/// .baz();
35-
/// ```
36-
/// Visual:
37-
/// ```
38-
/// let foo = {
39-
/// aaaa;
40-
/// bbb;
41-
/// ccc
42-
/// }
43-
/// .bar
44-
/// .baz();
45-
/// ```
46-
///
47-
/// If the first item in the chain is a block expression, we align the dots with
48-
/// the braces.
49-
/// Block:
50-
/// ```
51-
/// let a = foo.bar
52-
/// .baz()
53-
/// .qux
54-
/// ```
55-
/// Visual:
56-
/// ```
57-
/// let a = foo.bar
58-
/// .baz()
59-
/// .qux
60-
/// ```
11+
//! Formatting of chained expressions, i.e. expressions which are chained by
12+
//! dots: struct and enum field access, method calls, and try shorthand (?).
13+
//!
14+
//! Instead of walking these subexpressions one-by-one, as is our usual strategy
15+
//! for expression formatting, we collect maximal sequences of these expressions
16+
//! and handle them simultaneously.
17+
//!
18+
//! Whenever possible, the entire chain is put on a single line. If that fails,
19+
//! we put each subexpression on a separate, much like the (default) function
20+
//! argument function argument strategy.
21+
//!
22+
//! Depends on config options: `chain_indent` is the indent to use for
23+
//! blocks in the parent/root/base of the chain (and the rest of the chain's
24+
//! alignment).
25+
//! E.g., `let foo = { aaaa; bbb; ccc }.bar.baz();`, we would layout for the
26+
//! following values of `chain_indent`:
27+
//! Block:
28+
//! ```
29+
//! let foo = {
30+
//! aaaa;
31+
//! bbb;
32+
//! ccc
33+
//! }.bar
34+
//! .baz();
35+
//! ```
36+
//! Visual:
37+
//! ```
38+
//! let foo = {
39+
//! aaaa;
40+
//! bbb;
41+
//! ccc
42+
//! }
43+
//! .bar
44+
//! .baz();
45+
//! ```
46+
//!
47+
//! If the first item in the chain is a block expression, we align the dots with
48+
//! the braces.
49+
//! Block:
50+
//! ```
51+
//! let a = foo.bar
52+
//! .baz()
53+
//! .qux
54+
//! ```
55+
//! Visual:
56+
//! ```
57+
//! let a = foo.bar
58+
//! .baz()
59+
//! .qux
60+
//! ```
6161
6262
use shape::Shape;
6363
use config::IndentStyle;

0 commit comments

Comments
 (0)