You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-07-03 13:29:52 +02:00
Update destructuring-arrays.md (#369)
* Update destructuring-arrays.md * Update destructuring-arrays.md
This commit is contained in:
@ -8,7 +8,7 @@ You can destructure arrays, tuples, and slices by matching on their elements:
|
|||||||
|
|
||||||
<details>
|
<details>
|
||||||
|
|
||||||
Destructuring of slices of unknown length also works with patterns of fixed length.
|
* Destructuring of slices of unknown length also works with patterns of fixed length.
|
||||||
|
|
||||||
```rust,editable
|
```rust,editable
|
||||||
fn main() {
|
fn main() {
|
||||||
@ -26,5 +26,5 @@ fn inspect(slice: &[i32]) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
* Show matching against the tail with patterns `[.., b]` and `[a@..,b]`
|
||||||
</details>
|
</details>
|
||||||
|
Reference in New Issue
Block a user