mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
strings: add Builder.write_rune/1 and Builder.write_runes/1 methods
This commit is contained in:
@@ -34,9 +34,7 @@ pub fn (c rune) str() string {
|
||||
[manualfree]
|
||||
pub fn (ra []rune) string() string {
|
||||
mut sb := strings.new_builder(ra.len)
|
||||
for r in ra {
|
||||
sb.write_string(r.str())
|
||||
}
|
||||
sb.write_runes(ra)
|
||||
res := sb.str()
|
||||
unsafe { sb.free() }
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user