From d301b753bfffb9ad1790c08dbab8c33b815b7e4c Mon Sep 17 00:00:00 2001 From: Rutger Broekhoff Date: Mon, 24 May 2021 14:36:56 +0200 Subject: Clean up more Clean up unnecessary error unions, generate allowed characters table for credentials file sections at compile time. --- src/crc16.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/crc16.zig') diff --git a/src/crc16.zig b/src/crc16.zig index b00c795..2c49500 100644 --- a/src/crc16.zig +++ b/src/crc16.zig @@ -1,4 +1,4 @@ -const Error = error{InvalidChecksum}; +pub const InvalidChecksumError = error{InvalidChecksum}; const crc16tab: [256]u16 = tab: { @setEvalBranchQuota(10000); @@ -36,6 +36,6 @@ pub fn make(data: []const u8) u16 { } // validate will check the calculated CRC16 checksum for data against the expected. -pub fn validate(data: []const u8, expected: u16) !void { +pub fn validate(data: []const u8, expected: u16) InvalidChecksumError!void { if (make(data) != expected) return error.InvalidChecksum; } -- cgit v1.2.3