Using macro to implement the comprehensions of imitating python language in rust
- You can initialize common collection types with relatively little code
Vec [v],HashMap {k=>v}andHashSet {k}have been implemented- VecSyntax:
(<types>)?(\(capacity\))?([result; for\(...\)((for|if)\(...\))*])
crate: https://crates.io/crates/set_derive
Examples
use *;
# use ;
assert_eq!;
let a = set_derive!;
assert_eq!;
let a = set_derive!;
assert_eq!;
assert_eq!;
let a = set_derive!;
assert_eq!;
let a = set_derive!;
assert_eq!;