| author | |
| committer | |
| log | 1bb5dc7368098c1cb5384cc4a63b89b05e7865f0 |
| tree | 23f65368380c4d2f938206ec88494e3bce6f3892 |
| parent | 547d1d86fa2eabca61ffe780d3efe71b7dfbd53f |
1 files changed, 9 insertions(+), 0 deletions(-)
src/lib.zig+9| ... | @@ -478,3 +478,12 @@ pub fn sliceTo(comptime T: type, haystack: []const T, needle: T) []const T { | ... | @@ -478,3 +478,12 @@ pub fn sliceTo(comptime T: type, haystack: []const T, needle: T) []const T { |
| 478 | } | 478 | } |
| 479 | return haystack; | 479 | return haystack; |
| 480 | } | 480 | } |
| 481 | |||
| 482 | pub fn matchesAll(comptime T: type, haystack: []const u8, comptime needle: fn (T) bool) bool { | ||
| 483 | for (haystack) |c| { | ||
| 484 | if (!needle(c)) { | ||
| 485 | return false; | ||
| 486 | } | ||
| 487 | } | ||
| 488 | return true; | ||
| 489 | } |