cbor: prepare for publishing as standalone crate

- Add an example of usage
- Add a minimal README, including the example code
- Document public items
- Add more info to Cargo.toml
This commit is contained in:
David Drysdale
2021-06-09 10:12:55 +01:00
committed by kaczmarczyck
parent 7719078d46
commit 3aca5fbc74
7 changed files with 200 additions and 2 deletions

View File

@@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//! Convenience macros for working with CBOR values.
use crate::values::Value;
use alloc::vec;
use core::cmp::Ordering;
@@ -110,6 +112,7 @@ pub fn destructure_cbor_map_peek_value(
}
}
/// Assert that the keys in a vector of key-value pairs are in canonical order.
#[macro_export]
macro_rules! assert_sorted_keys {
// Last key