From 448f60422a416068f96cd085208d440a4ea9fac4 Mon Sep 17 00:00:00 2001 From: Adam Oates <31167933+islonely@users.noreply.github.com> Date: Fri, 1 Sep 2023 02:08:47 -0500 Subject: [PATCH] docs: fix notice for the doc samples, turn `a[1..4]` to `unsafe { a[1..4] }` (fix #19249) (#19254) --- doc/docs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/docs.md b/doc/docs.md index 821ce5e0d7..f2c0cb7be0 100644 --- a/doc/docs.md +++ b/doc/docs.md @@ -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