This commit is contained in:
Martin Algesten
2018-06-16 10:50:23 +02:00
parent d1cf9fde3b
commit 5b237066e5
7 changed files with 171 additions and 64 deletions

View File

@@ -1,3 +1,19 @@
/// Create a `HashMap` from a shorthand notation.
///
/// ```
/// #[macro_use]
/// extern crate ureq;
///
/// fn main() {
/// let headers = map! {
/// "X-API-Key" => "foobar",
/// "Accept" => "application/json"
/// };
///
/// let agent = ureq::agent().set_map(headers).build();
/// }
/// ```
#[macro_export]
macro_rules! map(
{ $($key:expr => $value:expr),* } => {