Skip to content
This repository was archived by the owner on Oct 9, 2018. It is now read-only.

Commit 6cdc15b

Browse files
committed
Added guideline on consuming structs and tuples
1 parent 15f180e commit 6cdc15b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

features/let.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,11 @@ let mut v = Vec::new();
9393
let v = v;
9494
// use v immutably henceforth
9595
```
96+
97+
### Prefer to bind all `struct` or tuple fields. [RFC]
98+
99+
When consuming a `struct` or tuple via a `let`, bind all of the fields rather
100+
than using `..` to elide the ones you don't need. The benefit is that when
101+
fields are added, the compiler will pinpoint all of the places where that type
102+
of value was consumed, which will often need to be adjusted to take the new
103+
field properly into account.

0 commit comments

Comments
 (0)