| // Copyright lowRISC contributors. |
| // Licensed under the Apache License, Version 2.0, see LICENSE for details. |
| // SPDX-License-Identifier: Apache-2.0 |
| |
| pub mod bigint; |
| pub mod bitfield; |
| pub mod file; |
| pub mod image; |
| pub mod parse_int; |
| pub mod usb; |
| pub mod voltage; |
| |
| /// The `collection` macro provides syntax for hash and set literals. |
| #[macro_export] |
| macro_rules! collection { |
| // map-like |
| ($($k:expr => $v:expr),* $(,)?) => {{ |
| use std::iter::{Iterator, IntoIterator}; |
| Iterator::collect(IntoIterator::into_iter([$(($k, $v),)*])) |
| }}; |
| |
| // set-like |
| ($($v:expr),* $(,)?) => {{ |
| use std::iter::{Iterator, IntoIterator}; |
| Iterator::collect(IntoIterator::into_iter([$($v),*])) |
| }}; |
| } |