From 2589eb99b3b3daa1f48e37b742a76f53cccad9e6 Mon Sep 17 00:00:00 2001 From: Guillaume Endignoux Date: Mon, 15 Jun 2020 17:00:19 +0200 Subject: [PATCH] Update read_cbor_map example to use a text key as well. --- libraries/cbor/src/macros.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libraries/cbor/src/macros.rs b/libraries/cbor/src/macros.rs index d8dc860..9cf4178 100644 --- a/libraries/cbor/src/macros.rs +++ b/libraries/cbor/src/macros.rs @@ -46,7 +46,7 @@ use core::iter::Peekable; /// read_cbor_map! { /// let { /// 1 => x, -/// 2 => y, +/// "key" => y, /// } = map; /// }; /// # } @@ -59,8 +59,9 @@ use core::iter::Peekable; /// # /// # fn main() { /// # let mut map = alloc::collections::BTreeMap::::new(); -/// let x: Option = map.remove(&cbor_unsigned!(1)); -/// let y: Option = map.remove(&cbor_unsigned!(2)); +/// use cbor::values::IntoCborKey; +/// let x: Option = map.remove(&1.into_cbor_key()); +/// let y: Option = map.remove(&"key".into_cbor_key()); /// # } /// ``` #[macro_export]