Compare commits
3 commits
e21a7308c3
...
f149909075
| Author | SHA1 | Date | |
|---|---|---|---|
| f149909075 | |||
| b1e784dbb2 | |||
| d89a3b2a93 |
2 changed files with 634 additions and 762 deletions
|
|
@ -74,8 +74,13 @@ pub fn main(init: std.process.Init) !void {
|
||||||
|
|
||||||
if (std.mem.eql(u8, format, "srf")) {
|
if (std.mem.eql(u8, format, "srf")) {
|
||||||
var reader = std.Io.Reader.fixed(data.items);
|
var reader = std.Io.Reader.fixed(data.items);
|
||||||
const records = try srf.parse(&reader, allocator, .{ .parse_allocator = .none });
|
const it = try srf.iterator(&reader, allocator, .{ .parse_allocator = .none });
|
||||||
defer records.deinit();
|
defer it.deinit();
|
||||||
|
// We want to touch every field, otherwise we're not really excercising
|
||||||
|
// this appropriately
|
||||||
|
while (try it.next()) |rec| {
|
||||||
|
while (try rec.next()) |_| {}
|
||||||
|
}
|
||||||
} else if (std.mem.eql(u8, format, "jsonl")) {
|
} else if (std.mem.eql(u8, format, "jsonl")) {
|
||||||
var lines = std.mem.splitScalar(u8, data.items, '\n');
|
var lines = std.mem.splitScalar(u8, data.items, '\n');
|
||||||
while (lines.next()) |line| {
|
while (lines.next()) |line| {
|
||||||
|
|
|
||||||
1387
src/srf.zig
1387
src/srf.zig
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue