authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-02-14 20:24:05 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-02-14 20:24:05 -08:00
log20a6bcda25842a129b6447b8ab852104e07edad7
treeb7ac243487ee15c4fe7058d0a994c2b660a7db8a
parentd724aefba7f83ffdfb4065eec36bd57794031927

add is()


1 files changed, 6 insertions(+), 0 deletions(-)

src/lib.zig+6
...@@ -408,3 +408,9 @@ pub fn skipToBoundary(pos: u64, boundary: u64, reader: anytype) !void {...@@ -408,3 +408,9 @@ pub fn skipToBoundary(pos: u64, boundary: u64, reader: anytype) !void {
408 const b = boundary;408 const b = boundary;
409 try reader.skipBytes(((a + (b - 1)) & ~(b - 1)) - a, .{});409 try reader.skipBytes(((a + (b - 1)) & ~(b - 1)) - a, .{});
410}410}
411
412/// ?A == A fails
413/// ?A == @as(?A, b) works
414pub fn is(a: anytype, b: @TypeOf(a)) bool {
415 return a == b;
416}