Skip to content

Commit

Permalink
Impls
Browse files Browse the repository at this point in the history
cc #25
  • Loading branch information
nrc committed Feb 5, 2018
1 parent b366a83 commit 77c8349
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions guide/items.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,40 @@ pub trait IndexRanges:
```


### Impls

Impl items should be block indented. If there are no items, the impl may be
formatted on a single line. Otherwise there should be line-breaks after the
opening brace and before the closing brace:

```rust
impl Foo {}

impl Bar for Foo {
...
}
```

Avoid line-breaking in the signature if possible. If a line break is required in
a non-inherent impl, break immediately before `for`, block indent the concrete type
and put the opening brace on it's own line:

```rust
impl Bar
for Foo
{
...
}
```


### Extern crate

`extern crate foo;`

Use spaces around keywords, no spaces around the semi-colon.


### Modules

```rust
Expand Down

0 comments on commit 77c8349

Please sign in to comment.