Change strings.Builder to be distinct [dynamic]byte from a struct wrapper

This commit is contained in:
gingerBill
2026-06-09 13:56:10 +01:00
parent d80720e30d
commit 2f3aefbb3d
12 changed files with 108 additions and 111 deletions

View File

@@ -68,9 +68,9 @@ _os_version :: proc (allocator: runtime.Allocator, loc := #caller_location) -> (
build = string(cstring(raw_data(build_buf[:])))
}
ws(&b, " (build ")
build_start := len(b.buf)
build_start := len(b)
ws(&b, build)
res.release = string(b.buf[build_start:][:len(build)])
res.release = string(b[build_start:][:len(build)])
}
{

View File

@@ -65,7 +65,7 @@ _os_version :: proc (allocator: runtime.Allocator, loc := #caller_location) -> (
release_i := strings.builder_len(b)
strings.write_string(&b, string(cstring(&uts.release[0])))
release_str := string(b.buf[release_i:])
release_str := string(b[release_i:])
res.full = strings.to_string(b)