From 6548331ec9fc0889ff456bd8610340499386e027 Mon Sep 17 00:00:00 2001 From: Niles Salter Date: Thu, 27 Jul 2023 05:54:55 -0600 Subject: [PATCH] Doc nitpick `slice[i]` should assert `len > i` --- doc/langref.html.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/langref.html.in b/doc/langref.html.in index b08e859f95..8f9874c276 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -3018,7 +3018,7 @@ test "basic slices" { slice[10] += 1; // Note that `slice.ptr` does not invoke safety checking, while `&slice[0]` - // asserts that the slice has len >= 1. + // asserts that the slice has len > 0. } {#code_end#}

This is one reason we prefer slices to pointers.