fn indexOfPosLinear(comptime T: type, haystack: []const T, start_index: usize, needle: []const T) ?usize

Consider using indexOfPos instead of this, which will automatically use a more sophisticated algorithm on larger inputs.

Parameters

T: type,
haystack: []const T,
start_index: usize,
needle: []const T,