diff options
Diffstat (limited to 'src/main.zig')
| -rw-r--r-- | src/main.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.zig b/src/main.zig index 38ba343..7ff07ee 100644 --- a/src/main.zig +++ b/src/main.zig | |||
| @@ -6,7 +6,7 @@ const std = @import("std"); | |||
| 6 | // const codePointWidth = @import("display_width").codePointWidth; | 6 | // const codePointWidth = @import("display_width").codePointWidth; |
| 7 | // const strWidth = @import("ziglyph").display_width.strWidth; | 7 | // const strWidth = @import("ziglyph").display_width.strWidth; |
| 8 | const strWidth = @import("display_width").strWidth; | 8 | const strWidth = @import("display_width").strWidth; |
| 9 | const CodePointIterator = @import("CodePoint").CodePointIterator; | 9 | // const CodePointIterator = @import("CodePoint").CodePointIterator; |
| 10 | 10 | ||
| 11 | pub fn main() !void { | 11 | pub fn main() !void { |
| 12 | var gpa = std.heap.GeneralPurposeAllocator(.{}){}; | 12 | var gpa = std.heap.GeneralPurposeAllocator(.{}){}; |
| @@ -16,12 +16,12 @@ pub fn main() !void { | |||
| 16 | const input = try std.fs.cwd().readFileAlloc(allocator, "lang_mix.txt", std.math.maxInt(u32)); | 16 | const input = try std.fs.cwd().readFileAlloc(allocator, "lang_mix.txt", std.math.maxInt(u32)); |
| 17 | defer allocator.free(input); | 17 | defer allocator.free(input); |
| 18 | 18 | ||
| 19 | var result: usize = 0; | ||
| 20 | // var result: isize = 0; | ||
| 21 | // var iter = GraphemeIterator.init(input); | 19 | // var iter = GraphemeIterator.init(input); |
| 22 | // var iter = CodePointIterator{ .bytes = input }; | 20 | // var iter = CodePointIterator{ .bytes = input }; |
| 23 | var iter = std.mem.splitScalar(u8, input, '\n'); | 21 | var iter = std.mem.splitScalar(u8, input, '\n'); |
| 24 | 22 | ||
| 23 | var result: usize = 0; | ||
| 24 | // var result: isize = 0; | ||
| 25 | var timer = try std.time.Timer.start(); | 25 | var timer = try std.time.Timer.start(); |
| 26 | 26 | ||
| 27 | // for (0..50) |_| { | 27 | // for (0..50) |_| { |