same_elements 0.1.0

Function to test if two collections contain the same values
Documentation
  • Coverage
  • 33.33%
    1 out of 3 items documented0 out of 2 items with examples
  • Size
  • Source code size: 20.18 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.02 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • scott97

Same Elements

Function to test if two collections contain the same values.

Sometimes when creating unit tests, I need to test that two slices contain the same values, but not necessarily in the same order. You can sort the values before testing that the two slices are identical, or alternatively, you can use this crate instead.

Example code

use same_elements::*;

let a = [1,2,3,4,5];
let b = [2,4,1,3,5];
assert!(a.same_elements(&b));