diff options
| author | 2025-09-13 08:38:24 -0700 | |
|---|---|---|
| committer | 2025-09-14 01:48:41 -0700 | |
| commit | a3b5e884b12fdaa341010ef41bb9382fa0cd89f8 (patch) | |
| tree | 8bdd22c1c54da0b56ef6b9fe0dc4c2ca667b71a3 /src/DisplayWidth.zig | |
| parent | Update build to 0.15.0 (diff) | |
| download | zg-a3b5e884b12fdaa341010ef41bb9382fa0cd89f8.tar.gz zg-a3b5e884b12fdaa341010ef41bb9382fa0cd89f8.tar.xz zg-a3b5e884b12fdaa341010ef41bb9382fa0cd89f8.zip | |
Update codebase to Zig 0.15.1.
Removes compression support
Diffstat (limited to 'src/DisplayWidth.zig')
| -rw-r--r-- | src/DisplayWidth.zig | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/DisplayWidth.zig b/src/DisplayWidth.zig index 3da2d24..82b2649 100644 --- a/src/DisplayWidth.zig +++ b/src/DisplayWidth.zig | |||
| @@ -39,11 +39,9 @@ pub fn setupWithGraphemes(dw: *DisplayWidth, allocator: Allocator, graphemes: Gr | |||
| 39 | 39 | ||
| 40 | // Sets up the DisplayWidthData, leaving the GraphemeData undefined. | 40 | // Sets up the DisplayWidthData, leaving the GraphemeData undefined. |
| 41 | pub fn setup(dw: *DisplayWidth, allocator: Allocator) Allocator.Error!void { | 41 | pub fn setup(dw: *DisplayWidth, allocator: Allocator) Allocator.Error!void { |
| 42 | const decompressor = compress.flate.inflate.decompressor; | ||
| 43 | const in_bytes = @embedFile("dwp"); | 42 | const in_bytes = @embedFile("dwp"); |
| 44 | var in_fbs = std.io.fixedBufferStream(in_bytes); | 43 | var in_fbs = std.io.fixedBufferStream(in_bytes); |
| 45 | var in_decomp = decompressor(.raw, in_fbs.reader()); | 44 | var reader = in_fbs.reader(); |
| 46 | var reader = in_decomp.reader(); | ||
| 47 | 45 | ||
| 48 | const endian = builtin.cpu.arch.endian(); | 46 | const endian = builtin.cpu.arch.endian(); |
| 49 | 47 | ||
| @@ -400,7 +398,7 @@ pub fn wrap( | |||
| 400 | columns: usize, | 398 | columns: usize, |
| 401 | threshold: usize, | 399 | threshold: usize, |
| 402 | ) ![]u8 { | 400 | ) ![]u8 { |
| 403 | var result = ArrayList(u8).init(allocator); | 401 | var result = std.array_list.Managed(u8).init(allocator); |
| 404 | defer result.deinit(); | 402 | defer result.deinit(); |
| 405 | 403 | ||
| 406 | var line_iter = mem.tokenizeAny(u8, str, "\r\n"); | 404 | var line_iter = mem.tokenizeAny(u8, str, "\r\n"); |
| @@ -460,8 +458,6 @@ test "allocation test" { | |||
| 460 | const std = @import("std"); | 458 | const std = @import("std"); |
| 461 | const builtin = @import("builtin"); | 459 | const builtin = @import("builtin"); |
| 462 | const options = @import("options"); | 460 | const options = @import("options"); |
| 463 | const ArrayList = std.ArrayList; | ||
| 464 | const compress = std.compress; | ||
| 465 | const mem = std.mem; | 461 | const mem = std.mem; |
| 466 | const Allocator = mem.Allocator; | 462 | const Allocator = mem.Allocator; |
| 467 | const simd = std.simd; | 463 | const simd = std.simd; |