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

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
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)