From d2a38e9c2952ec4b003a5ba58f70fc21fcf088c5 Mon Sep 17 00:00:00 2001 From: Jose Colon Rodriguez Date: Mon, 12 Feb 2024 19:04:50 -0400 Subject: Flat array --- src/Grapheme.zig | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/Grapheme.zig') diff --git a/src/Grapheme.zig b/src/Grapheme.zig index 73f6d57..a8a7638 100644 --- a/src/Grapheme.zig +++ b/src/Grapheme.zig @@ -1,15 +1,13 @@ //! `Grapheme` represents a Unicode grapheme cluster by its length and offset in the source bytes. const std = @import("std"); -const mem = std.mem; const unicode = std.unicode; const CodePoint = @import("ziglyph").CodePoint; const CodePointIterator = CodePoint.CodePointIterator; const emoji = @import("ziglyph").emoji; -// const gbp = @import("gbp"); -const gbp = @import("gbp.zig"); +const gbp = @import("gbp"); pub const Grapheme = @This(); @@ -34,8 +32,7 @@ pub const GraphemeIterator = struct { const Self = @This(); /// Assumes `src` is valid UTF-8. - pub fn init(allocator: mem.Allocator, str: []const u8) !Self { - try gbp.init(allocator); + pub fn init(str: []const u8) Self { var self = Self{ .cp_iter = CodePointIterator{ .bytes = str } }; self.buf[1] = self.cp_iter.next(); -- cgit v1.2.3