| author | |
| committer | |
| log | cd255f12edeb9a396afc6a44f88e6c224a8dc8e9 |
| tree | b3d7fd6dd425f7e9cc56a895d7acef50790960bd |
| parent | 1bb5dc7368098c1cb5384cc4a63b89b05e7865f0 |
1 files changed, 5 insertions(+), 0 deletions(-)
src/lib.zig+5| ... | @@ -487,3 +487,8 @@ pub fn matchesAll(comptime T: type, haystack: []const u8, comptime needle: fn (T | ... | @@ -487,3 +487,8 @@ pub fn matchesAll(comptime T: type, haystack: []const u8, comptime needle: fn (T |
| 487 | } | 487 | } |
| 488 | return true; | 488 | return true; |
| 489 | } | 489 | } |
| 490 | |||
| 491 | pub fn opslice(slice: anytype, index: usize) ?std.meta.Child(@TypeOf(slice)) { | ||
| 492 | if (slice.len <= index) return null; | ||
| 493 | return slice[index]; | ||
| 494 | } |