retain_range 0.1.1

Extension of Vec::retain to operate only on part of the vector defined by a range.
Documentation
  • Coverage
  • 0%
    0 out of 4 items documented0 out of 3 items with examples
  • Size
  • Source code size: 6.73 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.17 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • kwyntes

retain_range

Extension of Vec::retain to operate only on part of the vector defined by a range.

let mut vec = vec![1, 2, 3, 4, 5];
vec.retain_range(1..=3, |&x| x <= 2);
assert_eq!(vec, [1, 2, 5]);