mirror of
https://github.com/vlang/v.git
synced 2025-09-15 23:42:28 +03:00
builtin: more byte => u8
This commit is contained in:
parent
1e7eb713fb
commit
7f3b91e688
2 changed files with 11 additions and 11 deletions
|
@ -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]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue