rb_string_indices
is a rust native extension for ruby String that returns all indices for matches of a given substring.
It's using a ruby and rust interop library called rutie.
>> require 'rb_string_indices'
>> RbStringIndices.rb_string_indices('zomg wot a cool toy', 'o')
#=> [1, 6, 12, 13, 17]
Not really. Just one example.
$ bundle
$ rake test
** Invoke test (first_time)
** Execute test
Run options: --seed 17448
# Running:
.
Finished in 0.000680s, 1469.9397 runs/s, 1469.9397 assertions/s.
1 runs, 1 assertions, 0 failures, 0 errors, 0 skips
Just a fun toy project.