subslice-offset 0.1.1

Get offset of subslice in its parent slice
Documentation
  • Coverage
  • 66.67%
    2 out of 3 items documented1 out of 3 items with examples
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Mainzu

A tiny utility crate for finding the offset of a subslice within another slice. Note that this is not done through pattern matching but with pointer arithmetic instead.

To use, simply include this crate and use the [SubsliceOffset] trait. The [subslice_offset][SubsliceOffset::subslice_offset] method should then appear on [slices][slice].

I do not take any credit for this crate, full credit goes to https://stackoverflow.com/a/50781657