Skip to content

Commit 715efa4

Browse files
committed
style-guide: Remove material about tool configurability
The style guide discusses the default Rust style. Configurability of Rust formatting tools are not the domain of the style guide.
1 parent e2a7ba2 commit 715efa4

File tree

4 files changed

+2
-46
lines changed

4 files changed

+2
-46
lines changed

src/doc/style-guide/src/README.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ options.
4040
* Each level of indentation must be four spaces (that is, all indentation
4141
outside of string literals and comments must be a multiple of four).
4242
* The maximum width for a line is 100 characters.
43-
* A tool may choose to make some of these configurable.
4443

4544
#### Block indent
4645

@@ -99,8 +98,6 @@ fn bar() {}
9998
fn baz() {}
10099
```
101100

102-
Formatting tools may wish to make the bounds on blank lines configurable.
103-
104101
### [Module-level items](items.md)
105102
### [Statements](statements.md)
106103
### [Expressions](expressions.md)
@@ -231,10 +228,6 @@ complexity of an item (for example, that all components must be simple names,
231228
not more complex sub-expressions). For more discussion on suitable heuristics,
232229
see [this issue](https://github.com/rust-lang-nursery/fmt-rfcs/issues/47).
233230

234-
Tools should give the user an option to ignore such heuristics and always use
235-
the normal formatting.
236-
237-
238231
## [Non-formatting conventions](advice.md)
239232

240233
## [Cargo.toml conventions](cargo.md)

src/doc/style-guide/src/expressions.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -814,8 +814,7 @@ let arr = [combinable(
814814
)];
815815
```
816816

817-
Such behaviour should extend recursively, however, tools may choose to limit the
818-
depth of nesting.
817+
Such behaviour should extend recursively.
819818

820819
Only where the multi-line sub-expression is a closure with an explicit block,
821820
this combining behaviour may be used where there are other arguments, as long as
@@ -852,9 +851,6 @@ compound expression, then use parentheses around it, e.g., `..(x + 1)`,
852851
Hexadecimal literals may use upper- or lower-case letters, but they must not be
853852
mixed within the same literal. Projects should use the same case for all
854853
literals, but we do not make a recommendation for either lower- or upper-case.
855-
Tools should have an option to convert mixed case literals to upper-case, and
856-
may have an option to convert all literals to either lower- or upper-case.
857-
858854

859855
## Patterns
860856

src/doc/style-guide/src/items.md

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ alphabetically. When sorting, `self` and `super` must come before any other
1515
names. Module declarations should not be moved if they are annotated with
1616
`#[macro_use]`, since that may be semantics changing.
1717

18-
Tools should make the above ordering optional.
19-
20-
2118
### Function definitions
2219

2320
In Rust, people often find functions by searching for `fn [function-name]`, so
@@ -372,33 +369,6 @@ where
372369
+ Index<RangeToInclusive<Idx>, Output = Self::Output> + Index<RangeFull>
373370
```
374371

375-
#### Option - `where_single_line`
376-
377-
`where_single_line` is `false` by default. If `true`, then a where clause with
378-
exactly one component may be formatted on a single line if the rest of the
379-
item's signature is also kept on one line. In this case, there is no need for a
380-
trailing comma and if followed by a block, no need for a newline before the
381-
block. E.g.,
382-
383-
```rust
384-
// May be single-lined.
385-
fn foo<T>(args) -> ReturnType
386-
where T: Bound {
387-
body
388-
}
389-
390-
// Must be multi-lined.
391-
fn foo<T>(
392-
args
393-
) -> ReturnType
394-
where
395-
T: Bound,
396-
{
397-
body
398-
}
399-
```
400-
401-
402372
### Type aliases
403373

404374
Type aliases should generally be kept on one line. If necessary to break the
@@ -458,7 +428,7 @@ use a::b::{foo, bar, baz};
458428
#### Large list imports
459429

460430
Prefer to use multiple imports rather than a multi-line import. However, tools
461-
should not split imports by default (they may offer this as an option).
431+
should not split imports by default.
462432

463433
If an import does require multiple lines (either because a list of single names
464434
does not fit within the max width, or because of the rules for nested imports

src/doc/style-guide/src/statements.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,6 @@ following are true:
120120
let Some(1) = opt else { return };
121121
```
122122

123-
Formatters may allow users to configure the value of the threshold
124-
used to determine whether a let-else statement is *short*.
125-
126123
Otherwise, the let-else statement requires some line breaks.
127124

128125
If breaking a let-else statement across multiple lines, never break between the

0 commit comments

Comments
 (0)