Skip to content

Commit 448f604

Browse files
authored
docs: fix notice for the doc samples, turn a[1..4] to unsafe { a[1..4] } (fix #19249) (#19254)
1 parent fca8092 commit 448f604

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/docs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,7 @@ The behaviour depends on the parent's capacity and is predictable:
12311231

12321232
```v
12331233
mut a := []int{len: 5, cap: 6, init: 2}
1234-
mut b := a[1..4]
1234+
mut b := unsafe { a[1..4] }
12351235
a << 3
12361236
// no reallocation - fits in `cap`
12371237
b[2] = 13 // `a[3]` is modified

0 commit comments

Comments
 (0)