1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

strings: rename Builder.write_b() to Builder.write_byte(), add deprecation (#13313)

This commit is contained in:
Benjamin Stigsen
2022-01-28 19:34:44 +01:00
committed by GitHub
parent 7f22ed7935
commit ceb05b163a
23 changed files with 100 additions and 88 deletions

View File

@ -769,17 +769,17 @@ pub fn (a []string) str() string {
}
sb_len += 2 // 1x[ + 1x]
mut sb := strings.new_builder(sb_len)
sb.write_b(`[`)
sb.write_byte(`[`)
for i in 0 .. a.len {
val := a[i]
sb.write_b(`'`)
sb.write_byte(`'`)
sb.write_string(val)
sb.write_b(`'`)
sb.write_byte(`'`)
if i < a.len - 1 {
sb.write_string(', ')
}
}
sb.write_b(`]`)
sb.write_byte(`]`)
res := sb.str()
unsafe { sb.free() }
return res