mirror of
https://github.com/ziglang/zig.git
synced 2024-11-26 23:22:44 +00:00
Doc nitpick
`slice[i]` should assert `len > i`
This commit is contained in:
parent
e682d6eb29
commit
6548331ec9
@ -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#}
|
||||
<p>This is one reason we prefer slices to pointers.</p>
|
||||
|
Loading…
Reference in New Issue
Block a user