mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
builtin, strings: improve consistency and behavior regarding explicit mutability (#21566)
This commit is contained in:
parent
04ff511e27
commit
2a368cf53c
4 changed files with 10 additions and 9 deletions
|
@ -40,7 +40,7 @@ pub fn (mut b Builder) write_ptr(ptr &u8, len int) {
|
|||
@[manualfree]
|
||||
pub fn (mut b Builder) write_rune(r rune) {
|
||||
mut buffer := [5]u8{}
|
||||
res := unsafe { utf32_to_str_no_malloc(u32(r), &buffer[0]) }
|
||||
res := unsafe { utf32_to_str_no_malloc(u32(r), mut &buffer[0]) }
|
||||
if res.len == 0 {
|
||||
return
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ pub fn (mut b Builder) write_rune(r rune) {
|
|||
pub fn (mut b Builder) write_runes(runes []rune) {
|
||||
mut buffer := [5]u8{}
|
||||
for r in runes {
|
||||
res := unsafe { utf32_to_str_no_malloc(u32(r), &buffer[0]) }
|
||||
res := unsafe { utf32_to_str_no_malloc(u32(r), mut &buffer[0]) }
|
||||
if res.len == 0 {
|
||||
continue
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue