rev_slice

Crates.iorev_slice
lib.rsrev_slice
version0.1.5
sourcesrc
created_at2018-08-05 00:24:53.899546
updated_at2018-10-23 06:35:09.7965
descriptionA newtype for operating on a reversed view of a slice.
homepage
repositoryhttps://github.com/scottmcm/rev_slice
max_upload_size
id77542
size9,571
(scottmcm)

documentation

https://docs.rs/rev_slice

README

rev_slice

A simple alternative to negative indexing on rust slices

Ever wanted a[-1] in Rust? With this crate, you can do that as a.rev()[0].

Also provided are the other slice methods on the reversed slice, and you can .rev() again to get the original slice back. So you can, for example, remove the last element of a slice with a.rev()[1..].rev().

Commit count: 9

cargo fmt