Skip to content

Commit

Permalink
fix: Iterator definition
Browse files Browse the repository at this point in the history
  • Loading branch information
mochalins committed Sep 23, 2024
1 parent 5857276 commit 97b691c
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/serialport.zig
Original file line number Diff line number Diff line change
Expand Up @@ -221,19 +221,8 @@ pub const Stub = struct {
};

pub const Iterator = switch (builtin.target.os.tag) {
.linux => linux.Iterator,
.macos => macos.Iterator,
else => struct {
_impl: backend.IteratorImpl,

pub fn next(self: *@This()) !?Stub {
return self._impl.next();
}

pub fn deinit(self: *@This()) void {
self._impl.deinit();
}
},
.linux, .macos, .windows => backend.Iterator,
else => @compileError("unsupported OS"),
};

const backend = switch (builtin.target.os.tag) {
Expand Down

0 comments on commit 97b691c

Please sign in to comment.