cmp_wrap
Have you ever needed to compare the same data by different fields, depending on context? If so, this crate is for you!
Example
Using context
You probably have some kind of context in which you would like to compare your values, such as length of vectors or the first value.
use KeyCmpContext;
let by_length = new;
let long_vec = by_length.wrap;
let short_vec = by_length.wrap;
assert!;
By direct creation
you can define the key function on a "case by case" basis.
use CmpByKey;
let len_as_key = ;
let long_vec = new;
let short_vec = new;
assert!;
License: MIT