mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
builtin: more byte => u8
This commit is contained in:
@@ -12,22 +12,22 @@ pub mut:
|
||||
initial_size int = 1
|
||||
}*/
|
||||
|
||||
pub type Builder = []byte
|
||||
pub type Builder = []u8
|
||||
|
||||
pub fn new_builder(initial_size int) Builder {
|
||||
return []byte{cap: initial_size}
|
||||
return []u8{cap: initial_size}
|
||||
}
|
||||
|
||||
[deprecated: 'Use write_byte() instead']
|
||||
pub fn (mut b Builder) write_b(data byte) {
|
||||
pub fn (mut b Builder) write_b(data u8) {
|
||||
b << data
|
||||
}
|
||||
|
||||
pub fn (mut b Builder) write_byte(data byte) {
|
||||
pub fn (mut b Builder) write_byte(data u8) {
|
||||
b << data
|
||||
}
|
||||
|
||||
pub fn (mut b Builder) write(data []byte) ?int {
|
||||
pub fn (mut b Builder) write(data []u8) ?int {
|
||||
if data.len == 0 {
|
||||
return 0
|
||||
}
|
||||
@@ -35,7 +35,7 @@ pub fn (mut b Builder) write(data []byte) ?int {
|
||||
return data.len
|
||||
}
|
||||
|
||||
pub fn (b &Builder) byte_at(n int) byte {
|
||||
pub fn (b &Builder) byte_at(n int) u8 {
|
||||
unsafe {
|
||||
return b[n]
|
||||
}
|
||||
|
Reference in New Issue
Block a user