svec
Svec lets you create beautiful Dart-like lists in Rust that are both readable and concise.
If you're making a list of things in Rust, you're probably using vec
.
// a list
let row = vec!;
svec
lets you do all the things you can do with vec
, but it also adds "collection if" and "collection for".
// a list with svec
let row = svec!;
Here's a "collection for".
// a list with vec + svec
let row = vec!;
Using svec
in your project is super easy.
- Add
svec = 0.1.0
to yourCargo.toml
. - Add
use svec::*
.