Skip to content

Commit 0740270

Browse files
authored
Merge pull request #1429 from LudwikJaniuk/patch-1
Reformulated text for redability
2 parents eead22c + 48355aa commit 0740270

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/scope/move/partial_move.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# Partial moves
22

3-
Pattern bindings can have `by-move` and `by-reference` bindings at
4-
the same time which is used in [destructuring]. Using these pattern
5-
will result in partial move for the variable, which means that part
6-
of the variable is moved while other parts stayed. In this case, the
7-
parent variable cannot be used afterwards as a whole. However, parts
8-
of it that are referenced and not moved can be used.
3+
Within the [destructuring] of a single variable, both `by-move` and
4+
`by-reference` pattern bindings can be used at the same time. Doing
5+
this will result in a _partial move_ of the variable, which means
6+
that parts of the variable will be moved while other parts stay. In
7+
such a case, the parent variable cannot be used afterwards as a
8+
whole, however the parts that are only referenced (and not moved)
9+
can still be used.
910

1011
```rust,editable
1112
fn main() {
@@ -37,4 +38,4 @@ fn main() {
3738
### See also:
3839
[destructuring][destructuring]
3940

40-
[destructuring]: ../../flow_control/match/destructuring.md
41+
[destructuring]: ../../flow_control/match/destructuring.md

0 commit comments

Comments
 (0)