authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-07-31 18:18:59 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-07-31 18:18:59 -07:00
log41930cedb77d193e5cbfd6a2e4bed3d25262dd57
treef35146b81339389d3dc6e6c194ab23b0e70f3013
parentbd01c347af73ff79666d357545b3e821c83fdaf8

fix signature bug in matchesAll and matchesAny

previously it would error if T was anything other than u8

1 files changed, 2 insertions(+), 2 deletions(-)

src/lib.zig+2-2
......@@ -482,7 +482,7 @@ pub fn sliceTo(comptime T: type, haystack: []const T, needle: T) []const T {
482482 return haystack;
483483}
484484
485pub fn matchesAll(comptime T: type, haystack: []const u8, comptime needle: fn (T) bool) bool {
485pub fn matchesAll(comptime T: type, haystack: []const T, comptime needle: fn (T) bool) bool {
486486 for (haystack) |c| {
487487 if (!needle(c)) {
488488 return false;
......@@ -491,7 +491,7 @@ pub fn matchesAll(comptime T: type, haystack: []const u8, comptime needle: fn (T
491491 return true;
492492}
493493
494pub fn matchesAny(comptime T: type, haystack: []const u8, comptime needle: fn (T) bool) bool {
494pub fn matchesAny(comptime T: type, haystack: []const T, comptime needle: fn (T) bool) bool {
495495 for (haystack) |c| {
496496 if (needle(c)) {
497497 return true;