Skip to content
Snippets Groups Projects
Commit 479de32a authored by Julien Cretin's avatar Julien Cretin
Browse files

Rename $initial to $map

parent 491721b4
Branches
No related tags found
No related merge requests found
...@@ -52,18 +52,18 @@ macro_rules! cbor_map_options { ...@@ -52,18 +52,18 @@ macro_rules! cbor_map_options {
#[macro_export] #[macro_export]
macro_rules! extend_cbor_map_options { macro_rules! extend_cbor_map_options {
// Add trailing comma if missing. // Add trailing comma if missing.
( &mut $initial:expr, $( $key:expr => $value:expr ),+ ) => { ( &mut $map:expr, $( $key:expr => $value:expr ),+ ) => {
extend_cbor_map_options! ( &mut $initial, $($key => $value,)+ ) extend_cbor_map_options! ( &mut $map, $($key => $value,)+ )
}; };
( &mut $initial:expr, $( $key:expr => $value:expr, )* ) => { ( &mut $map:expr, $( $key:expr => $value:expr, )* ) => {
{ {
// The import is unused if the list is empty. // The import is unused if the list is empty.
#[allow(unused_imports)] #[allow(unused_imports)]
use $crate::values::{IntoCborKey, IntoCborValueOption}; use $crate::values::{IntoCborKey, IntoCborValueOption};
$( $(
if let Some(val) = $value.into_cbor_value_option() { if let Some(val) = $value.into_cbor_value_option() {
$initial.insert($key.into_cbor_key(), val); $map.insert($key.into_cbor_key(), val);
} }
)* )*
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment