From dfa0a6b4a6880b7baaa56e80f5891a723ea7d357 Mon Sep 17 00:00:00 2001 From: flywind Date: Tue, 2 Mar 2021 19:52:07 +0800 Subject: add runnableExamples for prepareStrMutation (#17227) * Update lib/system.nim Co-authored-by: Timothee Cour --- lib/system/strs_v2.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/system') diff --git a/lib/system/strs_v2.nim b/lib/system/strs_v2.nim index b20457d51..2647f7dcc 100644 --- a/lib/system/strs_v2.nim +++ b/lib/system/strs_v2.nim @@ -171,7 +171,7 @@ proc nimPrepareStrMutationV2(s: var NimStringV2) {.compilerRtl, inline.} = proc prepareStrMutation*(s: var string) {.inline.} = # string literals are "copy on write", so you need to call - # `prepareStrMutation` before modifying the strings. + # `prepareStrMutation` before modifying the strings via `addr`. {.cast(noSideEffect).}: let s = unsafeAddr s nimPrepareStrMutationV2(cast[ptr NimStringV2](s)[]) -- cgit 1.4.1-2-gfad0