Skip to content

Commit

Permalink
docs: fix notice for the doc samples, turn a[1..4] to `unsafe { a[1…
Browse files Browse the repository at this point in the history
…..4] }` (fix #19249) (#19254)
  • Loading branch information
islonely committed Sep 1, 2023
1 parent fca8092 commit 448f604
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/docs.md
Expand Up @@ -1231,7 +1231,7 @@ The behaviour depends on the parent's capacity and is predictable:

```v
mut a := []int{len: 5, cap: 6, init: 2}
mut b := a[1..4]
mut b := unsafe { a[1..4] }
a << 3
// no reallocation - fits in `cap`
b[2] = 13 // `a[3]` is modified
Expand Down

0 comments on commit 448f604

Please sign in to comment.