From 8d93174b1c0ade7d39e33446e1f7ccdbe15e43ec Mon Sep 17 00:00:00 2001 From: Vincent Rischmann Date: Mon, 2 May 2022 18:12:29 +0200 Subject: put the TODO comment at the end of the line instead When using an explicit error set one must add the "Workaround" error in their error set; putting the explanation as to why it exists at the end of the line makes it so it is displayed directly in the output of the compiler. Before a user had to go look at the source code to understand why we have this workaround. --- sqlite.zig | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/sqlite.zig b/sqlite.zig index 609744f..5299e7f 100644 --- a/sqlite.zig +++ b/sqlite.zig @@ -1222,25 +1222,19 @@ pub fn Iterator(comptime Type: type) type { } // readInt reads a sqlite INTEGER column into an integer. - // - // TODO remove the workaround once https://github.com/ziglang/zig/issues/5149 is resolved or if we actually return an error - fn readInt(self: *Self, comptime IntType: type, i: usize) error{Workaround}!IntType { + fn readInt(self: *Self, comptime IntType: type, i: usize) error{Workaround}!IntType { // TODO remove the workaround once https://github.com/ziglang/zig/issues/5149 is resolved or if we actually return an error const n = c.sqlite3_column_int64(self.stmt, @intCast(c_int, i)); return @intCast(IntType, n); } // readFloat reads a sqlite REAL column into a float. - // - // TODO remove the workaround once https://github.com/ziglang/zig/issues/5149 is resolved or if we actually return an error - fn readFloat(self: *Self, comptime FloatType: type, i: usize) error{Workaround}!FloatType { + fn readFloat(self: *Self, comptime FloatType: type, i: usize) error{Workaround}!FloatType { // TODO remove the workaround once https://github.com/ziglang/zig/issues/5149 is resolved or if we actually return an error const d = c.sqlite3_column_double(self.stmt, @intCast(c_int, i)); return @floatCast(FloatType, d); } // readFloat reads a sqlite INTEGER column into a bool (true is anything > 0, false is anything <= 0). - // - // TODO remove the workaround once https://github.com/ziglang/zig/issues/5149 is resolved or if we actually return an error - fn readBool(self: *Self, i: usize) error{Workaround}!bool { + fn readBool(self: *Self, i: usize) error{Workaround}!bool { // TODO remove the workaround once https://github.com/ziglang/zig/issues/5149 is resolved or if we actually return an error const d = c.sqlite3_column_int64(self.stmt, @intCast(c_int, i)); return d > 0; } -- cgit v1.2.3