cbor icon indicating copy to clipboard operation
cbor copied to clipboard

Add the cbor!() macro

Open npmccallum opened this issue 5 years ago • 2 comments

The cbor!() macro is inspired by serde_json::json!(), but the implementation is simpler and the macro should be more useful. In particular, the cbor!() macro returns Result<Value, Error>, so it can be used in places that need careful error handling.

npmccallum avatar Jul 06 '20 01:07 npmccallum

One decision I was on the fence about: cbor!(null) or cbor!(Null). The first one is closer to JSON and matches other keywords like true and false. The second one is closer to the Rust name. I could go either way. Let me know your preference.

npmccallum avatar Jul 06 '20 02:07 npmccallum

This could be a separate crate, right?

pyfisch avatar Jul 06 '20 07:07 pyfisch