Skip to content

Commit 080bfb5

Browse files
committed
std: Clean up some tests
No functional changes, remove some dead code.
1 parent 17011a0 commit 080bfb5

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

lib/std/dwarf.zig

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -413,10 +413,7 @@ pub const DwarfInfo = struct {
413413
var this_unit_offset: u64 = 0;
414414

415415
while (this_unit_offset < try seekable.getEndPos()) {
416-
seekable.seekTo(this_unit_offset) catch |err| switch (err) {
417-
error.EndOfStream => unreachable,
418-
else => return err,
419-
};
416+
try seekable.seekTo(this_unit_offset);
420417

421418
var is_64: bool = undefined;
422419
const unit_length = try readUnitLength(in, di.endian, &is_64);
@@ -520,10 +517,7 @@ pub const DwarfInfo = struct {
520517
var this_unit_offset: u64 = 0;
521518

522519
while (this_unit_offset < try seekable.getEndPos()) {
523-
seekable.seekTo(this_unit_offset) catch |err| switch (err) {
524-
error.EndOfStream => unreachable,
525-
else => return err,
526-
};
520+
try seekable.seekTo(this_unit_offset);
527521

528522
var is_64: bool = undefined;
529523
const unit_length = try readUnitLength(in, di.endian, &is_64);

test/stage1/behavior/union.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ test "@unionInit on union w/ tag but no fields" {
742742
const Data = union(Type) {
743743
no_op: void,
744744

745-
pub fn decode(buf: []const u8) !Data {
745+
pub fn decode(buf: []const u8) Data {
746746
return @unionInit(Data, "no_op", {});
747747
}
748748
};
@@ -753,7 +753,7 @@ test "@unionInit on union w/ tag but no fields" {
753753

754754
fn doTheTest() void {
755755
var data: Data = .{ .no_op = .{} };
756-
var o = try Data.decode(&[_]u8{});
756+
var o = Data.decode(&[_]u8{});
757757
expectEqual(Type.no_op, o);
758758
}
759759
};

0 commit comments

Comments
 (0)