You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's add examples, and let's move to this section two of the examples
from extending expressions, as they're actually demonstrations of
extending patterns.
* An [identifier pattern] that binds by reference or mutable reference.
414
-
* A [struct][struct pattern], [tuple][tuple pattern], [tuple struct][tuple
415
-
struct pattern], [slice][slice pattern], or [or-pattern][or-patterns] where at least one of the
416
-
direct subpatterns is an extending pattern.
417
414
418
-
So `ref x`, `V(ref x)` and `[ref x, y]` are all extending patterns, but `x`,
419
-
`&ref x` and `&(ref x,)` are not.
415
+
```rust
416
+
# fntemp() {}
417
+
letrefx=temp(); // Binds by reference.
418
+
# x;
419
+
letrefmutx=temp(); // Binds by mutable reference.
420
+
# x;
421
+
```
422
+
423
+
* A [struct][struct pattern], [tuple][tuple pattern], [tuple struct][tuple struct pattern], [slice][slice pattern], or [or-pattern][or-patterns] where at least one of the direct subpatterns is an extending pattern.
0 commit comments