easy_collections
These are wrappers around HashSet and HashMap which make them a little more convenient to use.
They aren't intended for use in main applications, but were created to make prototyping and writing short programs easier.
Usage
The struct EasySet wraps HashSet with some useful trait implementations.
use set;
let a = &set!;
let b = &set!;
assert_eq!; // intersection
assert_eq!; // union
assert_eq!; // symmetric difference
assert_eq!; // difference
let c = &set!;
assert!; // subset
assert!; // superset
assert!; // equality
The struct EasyMap wraps HashMap with some useful trait implementations.
use ;
// `42` here is the default value which is returned when no item exists in the map
// The default value is optional.
let map = map!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
// If you want to create a map with just a single value, and no default, use a trailing comma:
let map: = map!;
let map: = map!;
Also, both EasyMap and EasySet deref to their underlying collections, for example:
use ;
use ;
let easy: = set!;
let hash: & = &*easy;
assert_eq!;
let easy: = map!;
let hash: & = &*easy;
assert_eq!;
License: Unlicense OR MIT OR Apache-2.0