Skip to content

Commit

Permalink
bugfix: reflect how rustfmt formats type aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Aug 16, 2023
1 parent c57393e commit 85254c9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/doc/style-guide/src/items.md
Original file line number Diff line number Diff line change
Expand Up @@ -367,14 +367,14 @@ where
## Type aliases

Keep type aliases on one line when they fit. If necessary to break the line, do
so after the `=`, and block-indent the right-hand side:
so before the `=`, and block-indent the right-hand side:

```rust
pub type Foo = Bar<T>;

// If multi-line is required
type VeryLongType<T, U: SomeBound> =
AnEvenLongerType<T, U, Foo<T>>;
type VeryLongType<T, U: SomeBound>
= AnEvenLongerType<T, U, Foo<T>>;
```

Where possible avoid `where` clauses and keep type constraints inline. Where
Expand Down

0 comments on commit 85254c9

Please sign in to comment.