vortex_buffer/
macros.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/// A macro for constructing buffers akin to `vec![..]`.
#[macro_export]
macro_rules! buffer {
    () => (
        $crate::Buffer:empty()
    );
    ($elem:expr; $n:expr) => (
        $crate::Buffer::full($elem, $n)
    );
    ($($x:expr),+ $(,)?) => (
        $crate::Buffer::from_iter([$($x),+])
    );
}

/// A macro for constructing buffers akin to `vec![..]`.
#[macro_export]
macro_rules! buffer_mut {
    () => (
        $crate::BufferMut:empty()
    );
    ($elem:expr; $n:expr) => (
        $crate::BufferMut::full($elem, $n)
    );
    ($($x:expr),+ $(,)?) => (
        $crate::BufferMut::from_iter([$($x),+])
    );
}