| ... | ... | @@ -330,15 +330,12 @@ pub const Utf8View = struct { |
| 330 | 330 | return Utf8View{ .bytes = s }; |
| 331 | 331 | } |
| 332 | 332 | |
| 333 | | /// TODO: https://github.com/ziglang/zig/issues/425 |
| 334 | | pub fn initComptime(comptime s: []const u8) Utf8View { |
| 335 | | if (comptime init(s)) |r| { |
| 336 | | return r; |
| 337 | | } else |err| switch (err) { |
| 333 | pub inline fn initComptime(comptime s: []const u8) Utf8View { |
| 334 | return comptime if (init(s)) |r| r else |err| switch (err) { |
| 338 | 335 | error.InvalidUtf8 => { |
| 339 | 336 | @compileError("invalid utf8"); |
| 340 | 337 | }, |
| 341 | | } |
| 338 | }; |
| 342 | 339 | } |
| 343 | 340 | |
| 344 | 341 | pub fn iterator(s: Utf8View) Utf8Iterator { |