commit 17123299b8c1e02c7965dfc8dc9b467c566ba3d7
parent 8eb08f665aae1f499b0e16a53c55b2996f856ca7
Author: Bor Grošelj Simić <bgs@turminal.net>
Date: Thu, 11 Apr 2024 01:46:31 +0200
encoding::base64: improve encoder struct size
Signed-off-by: Bor Grošelj Simić <bgs@turminal.net>
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/encoding/base64/base64.ha b/encoding/base64/base64.ha
@@ -49,9 +49,9 @@ export type encoder = struct {
out: io::handle,
enc: *encoding,
ibuf: [3]u8,
- iavail: size,
obuf: [4]u8,
- oavail: size,
+ iavail: u8,
+ oavail: u8,
};
const encoder_vtable: io::vtable = io::vtable {
@@ -129,7 +129,7 @@ fn writeavail(s: *encoder) (void | io::error) = {
for (s.oavail > 0) {
let n = io::write(s.out, s.obuf[len(s.obuf) - s.oavail..])?;
- s.oavail -= n;
+ s.oavail -= n: u8;
};
if (s.oavail == 0) {