mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
all: add strings.Builder.write_string and use write_string instead of write (#8892)
This commit is contained in:
@ -142,7 +142,7 @@ fn pretty_description(s string, indent_len int) string {
|
||||
mut acc := strings.new_builder(((s.len / chars_per_line) + 1) * (width + 1))
|
||||
for k, line in s.split('\n') {
|
||||
if k != 0 {
|
||||
acc.write('\n$indent')
|
||||
acc.write_string('\n$indent')
|
||||
}
|
||||
mut i := chars_per_line - 2
|
||||
mut j := 0
|
||||
@ -152,16 +152,16 @@ fn pretty_description(s string, indent_len int) string {
|
||||
}
|
||||
// indent was already done the first iteration
|
||||
if j != 0 {
|
||||
acc.write(indent)
|
||||
acc.write_string(indent)
|
||||
}
|
||||
acc.writeln(line[j..i].trim_space())
|
||||
j = i
|
||||
}
|
||||
// We need this even though it should never happen
|
||||
if j != 0 {
|
||||
acc.write(indent)
|
||||
acc.write_string(indent)
|
||||
}
|
||||
acc.write(line[j..].trim_space())
|
||||
acc.write_string(line[j..].trim_space())
|
||||
}
|
||||
return acc.str()
|
||||
}
|
||||
|
Reference in New Issue
Block a user