Sugars - Nice Rust macros for better writing
This crate provides a collection of macros to make some tasks easier to use on Rust ecosystem.
What it has to offer?
- boxed: A simple macro to make a new Box value.
- btmap: Create a
BTreeMapfrom a list of key-value pairs - btset: Create a
BTreeSetfrom a list of elements - cmap: Macro to
HashMapcollection comprehensions¹ - cset: Macro to
HashSetcollection comprehensions¹ - cvec: Macro to
Veccollection comprehensions¹ - dur: Creates a
Durationobject following a time pattern² - hmap: Create a
HashMapfrom a list of key-value pairs - hset: Create a
HashSetfrom a list of elements - sleep: Makes a thread sleep a amount following a time pattern²
- time: Print out the time it took to execute a given expression in seconds
- The comprehension macros supports a haskell-like as well as python-like writing syntax and have the limitation of not supporting nesting
- A time pattern can be: mim, sec, nano, micro, milli
LICENSE
This software is licensed under the MIT Public License.