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

all: replace []byte with []u8

This commit is contained in:
Alexander Medvednikov
2022-04-15 15:35:35 +03:00
parent 0527ac633e
commit fb192d949b
164 changed files with 533 additions and 533 deletions

View File

@ -2,17 +2,17 @@ import io
struct Buf {
pub:
bytes []byte
bytes []u8
mut:
i int
}
struct Writ {
pub mut:
bytes []byte
bytes []u8
}
fn (mut b Buf) read(mut buf []byte) ?int {
fn (mut b Buf) read(mut buf []u8) ?int {
if !(b.i < b.bytes.len) {
return none
}
@ -21,7 +21,7 @@ fn (mut b Buf) read(mut buf []byte) ?int {
return n
}
fn (mut w Writ) write(buf []byte) ?int {
fn (mut w Writ) write(buf []u8) ?int {
if buf.len <= 0 {
return none
}
@ -34,7 +34,7 @@ fn test_copy() {
bytes: 'abcdefghij'.repeat(10).bytes()
}
mut dst := Writ{
bytes: []byte{}
bytes: []u8{}
}
io.cp(mut src, mut dst) or { assert false }
assert dst.bytes == src.bytes