std-macro-extensions 1.0.1

A collection of macro extensions for Rust's standard library data structures, simplifying the creation and manipulation of common collections such as HashMap, Vec, and more.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::*;

#[test]
fn test_empty_binary_heap() {
    let heap: BinaryHeap<i32> = binary_heap!();
    assert!(heap.is_empty());
}

#[test]
fn test_binary_heap_with_elements() {
    let heap: BinaryHeap<i32> = binary_heap!(5, 3, 8, 1);
    let vec: Vec<i32> = heap.into_sorted_vec();
    assert_eq!(vec, vec![1, 3, 5, 8]);
}