Add is_empty, preprend to standard lib / bytearray
This commit is contained in:
parent
9f374d9431
commit
98f90a572f
|
@ -8,6 +8,14 @@ pub fn length(bytes: ByteArray) -> Int {
|
||||||
builtin.lengthOfByteArray(bytes)
|
builtin.lengthOfByteArray(bytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn is_empty(bytes: ByteArray) -> Bool {
|
||||||
|
builtin.emptyByteArray(bytes)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn concat(left front: ByteArray, right back: ByteArray) -> ByteArray {
|
pub fn concat(left front: ByteArray, right back: ByteArray) -> ByteArray {
|
||||||
builtin.appendByteArray(front, back)
|
builtin.appendByteArray(front, back)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn prepend(rest: ByteArray, byte: Int) -> ByteArray {
|
||||||
|
builtin.consByteArray(byte, rest)
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue