commit 0c209140e81aa032d07362a4dc828e0721831368
parent 2abde1a4ad36f32546b40ccc88f870048467d941
Author: Bor Grošelj Simić <bgs@turminal.net>
Date: Wed, 27 Apr 2022 14:45:11 +0200
bytes: update outdated style
Signed-off-by: Bor Grošelj Simić <bgs@turminal.net>
Diffstat:
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/bytes/reverse.ha b/bytes/reverse.ha
@@ -16,13 +16,16 @@ export fn reverse(b: []u8) void = {
};
@test fn reverse() void = {
- let a: [4]u8 = [1, 3, 3, 7];
- reverse(a);
- assert(equal(a, [7, 3, 3, 1]));
+ let b: [4]u8 = [1, 3, 3, 7];
+ reverse(b);
+ assert(equal(b, [7, 3, 3, 1]));
let b: [5]u8 = [1, 2, 3, 4, 5];
reverse(b);
assert(equal(b, [5, 4, 3, 2, 1]));
- let c: []u8 = [];
- reverse(c);
- assert(equal(c, []));
+ let b: [1]u8 = [1];
+ reverse(b);
+ assert(equal(b, [1]));
+ let b: []u8 = [];
+ reverse(b);
+ assert(equal(b, []));
};
diff --git a/bytes/tokenize.ha b/bytes/tokenize.ha
@@ -4,7 +4,11 @@
// (c) 2021 Eyal Sawady <ecs@d2evs.net>
use types;
-export type tokenizer = struct { s: []u8, d: []u8, p: size };
+export type tokenizer = struct {
+ s: []u8,
+ d: []u8,
+ p: size,
+};
// Returns a tokenizer which yields sub-slices tokenized by a delimiter. The
// caller must ensure that 'delimiter' is not an empty slice.