Skip to content

Commit b39801d

Browse files
committed
Simplified the bit about the && vs & & in borrow expressions
1 parent e79d1ef commit b39801d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/expressions/operator-expr.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,18 @@ let mut array = [-2, 3, 9];
8585
}
8686
```
8787

88-
For ease of typing, consecutive borrow expressions can be expressed by the
89-
single token `&&` as if they were separated:
88+
Even though `&&` is a single token ([the lazy 'and' operator](#lazy-boolean-operators)),
89+
when used in the context of borrow expressions it works as two borrows:
9090

9191
```rust
9292
// same meanings:
9393
let a = && 10;
9494
let a = & & 10;
9595

9696
// same meanings:
97-
let a = && mut 10;
98-
let a = & & mut 10;
97+
let a = &&&& mut 10;
98+
let a = && && mut 10;
99+
let a = & & & & mut 10;
99100
```
100101

101102
## The dereference operator

0 commit comments

Comments
 (0)