From 41930cedb77d193e5cbfd6a2e4bed3d25262dd57 Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Mon, 31 Jul 2023 18:18:59 -0700 Subject: [PATCH] fix signature bug in matchesAll and matchesAny previously it would error if T was anything other than u8 --- src/lib.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.zig b/src/lib.zig index 244703eca09b7af37bddbd4199c0ba655542d204..4dc5054d0497198f28d818bb4a7125c658fc170d 100644 --- a/src/lib.zig +++ b/src/lib.zig @@ -482,7 +482,7 @@ pub fn sliceTo(comptime T: type, haystack: []const T, needle: T) []const T { return haystack; } -pub fn matchesAll(comptime T: type, haystack: []const u8, comptime needle: fn (T) bool) bool { +pub fn matchesAll(comptime T: type, haystack: []const T, comptime needle: fn (T) bool) bool { for (haystack) |c| { if (!needle(c)) { return false; @@ -491,7 +491,7 @@ pub fn matchesAll(comptime T: type, haystack: []const u8, comptime needle: fn (T return true; } -pub fn matchesAny(comptime T: type, haystack: []const u8, comptime needle: fn (T) bool) bool { +pub fn matchesAny(comptime T: type, haystack: []const T, comptime needle: fn (T) bool) bool { for (haystack) |c| { if (needle(c)) { return true; -- 2.54.0