mccolljr / segvec

SegVec data structure for rust. Similar to Vec, but allocates memory in chunks of increasing size.
MIT License
35 stars 5 forks source link

add `as_contiguous` to `Slice` #39

Closed vxpm closed 11 months ago

vxpm commented 1 year ago

adds a method to attempt turning a SegVec Slice (which is not necessarily contiguous) into a &[T] that can be useful whenever the Slice only spans a single segment.

mccolljr commented 11 months ago

Wow, I apologize - this slipped under my radar. This change makes sense, and I can see this being a useful optimization. Thank you for the contribution!