Skip to content

Commit

Permalink
Remove mention of _move suffix
Browse files Browse the repository at this point in the history
Fixes #37.
  • Loading branch information
dtolnay committed Aug 3, 2017
1 parent 19dc9f2 commit 1f7d24a
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/naming.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,8 @@ through suffixes.

### Exceptions

In the case of iterators, the moving variant can also be understood as an `into`
conversion, `into_iter`, and `for x in v.into_iter()` reads arguably better than
`for x in v.iter_move()`, so the convention is `into_iter`.
In the case of iterators, the moving variant should be understood as an `into`
conversion, `into_iter`.

For mutably borrowed variants, if the `mut` qualifier is part of a type name,
it should appear as it would appear in the type. For example
Expand All @@ -189,10 +188,8 @@ it should appear as it would appear in the type. For example

### Immutably borrowed by default

If `foo` uses/produces an immutable borrow by default, use:

* The `_mut` suffix (e.g. `foo_mut`) for the mutably borrowed variant.
* The `_move` suffix (e.g. `foo_move`) for the owned variant.
If `foo` uses/produces an immutable borrow by default, use a `_mut` suffix (e.g.
`foo_mut`) for the mutably borrowed variant.

#### Examples from the standard library

Expand Down

0 comments on commit 1f7d24a

Please sign in to comment.