strings: add Builder.cut_to (#10042)

This commit is contained in:
Enzo 2021-05-07 18:41:27 +02:00 committed by GitHub
parent b34b56ee4e
commit 2d2b4f79cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 20 deletions

View file

@ -44,11 +44,6 @@ pub fn (b []byte) clone() []byte {
// TODO remove this once runes are implemented
pub fn (b []byte) bytestr() string {
return bytes2string(b)
}
// TODO copy pasted from builder.v
fn bytes2string(b []byte) string {
unsafe {
buf := malloc(b.len + 1)
C.memcpy(buf, b.data, b.len)