Skip to content

Commit 1c6938b

Browse files
committed
zig: remove workaround for ziglang#5149
error.Workaround was being returned due to ziglang/zig#5149. This has been fixed. Remove the error and todo items
1 parent d95d073 commit 1c6938b

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

sqlite.zig

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,15 +1070,15 @@ pub fn Iterator(comptime Type: type) type {
10701070
switch (TypeInfo) {
10711071
.int => {
10721072
debug.assert(columns == 1);
1073-
return try self.readInt(Type, 0);
1073+
return self.readInt(Type, 0);
10741074
},
10751075
.float => {
10761076
debug.assert(columns == 1);
1077-
return try self.readFloat(Type, 0);
1077+
return self.readFloat(Type, 0);
10781078
},
10791079
.bool => {
10801080
debug.assert(columns == 1);
1081-
return try self.readBool(0);
1081+
return self.readBool(0);
10821082
},
10831083
.void => {
10841084
debug.assert(columns == 1);
@@ -1144,15 +1144,15 @@ pub fn Iterator(comptime Type: type) type {
11441144
switch (TypeInfo) {
11451145
.int => {
11461146
debug.assert(columns == 1);
1147-
return try self.readInt(Type, 0);
1147+
return self.readInt(Type, 0);
11481148
},
11491149
.float => {
11501150
debug.assert(columns == 1);
1151-
return try self.readFloat(Type, 0);
1151+
return self.readFloat(Type, 0);
11521152
},
11531153
.bool => {
11541154
debug.assert(columns == 1);
1155-
return try self.readBool(0);
1155+
return self.readBool(0);
11561156
},
11571157
.void => {
11581158
debug.assert(columns == 1);
@@ -1242,19 +1242,19 @@ pub fn Iterator(comptime Type: type) type {
12421242
}
12431243

12441244
// readInt reads a sqlite INTEGER column into an integer.
1245-
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
1245+
fn readInt(self: *Self, comptime IntType: type, i: usize) IntType {
12461246
const n = c.sqlite3_column_int64(self.stmt, @intCast(i));
12471247
return @intCast(n);
12481248
}
12491249

12501250
// readFloat reads a sqlite REAL column into a float.
1251-
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
1251+
fn readFloat(self: *Self, comptime FloatType: type, i: usize) FloatType {
12521252
const d = c.sqlite3_column_double(self.stmt, @intCast(i));
12531253
return @floatCast(d);
12541254
}
12551255

12561256
// readFloat reads a sqlite INTEGER column into a bool (true is anything > 0, false is anything <= 0).
1257-
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
1257+
fn readBool(self: *Self, i: usize) bool {
12581258
const d = c.sqlite3_column_int64(self.stmt, @intCast(i));
12591259
return d > 0;
12601260
}
@@ -1450,9 +1450,9 @@ pub fn Iterator(comptime Type: type) type {
14501450
break :blk try self.readBytes(Text, options.allocator, i, .Text);
14511451
},
14521452
else => switch (field_type_info) {
1453-
.int => try self.readInt(FieldType, i),
1454-
.float => try self.readFloat(FieldType, i),
1455-
.bool => try self.readBool(i),
1453+
.int => self.readInt(FieldType, i),
1454+
.float => self.readFloat(FieldType, i),
1455+
.bool => self.readBool(i),
14561456
.void => {},
14571457
.array => try self.readArray(FieldType, i),
14581458
.pointer => try self.readPointer(FieldType, options, i),

0 commit comments

Comments
 (0)