Skip to content
This repository has been archived by the owner on Aug 15, 2021. It is now read-only.

Add the cbor!() macro #201

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add the cbor!() macro #201

wants to merge 1 commit into from

Conversation

npmccallum
Copy link

@npmccallum npmccallum commented Jul 6, 2020

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.

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
Copy link
Author

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.

@pyfisch
Copy link
Owner

pyfisch commented Jul 6, 2020

This could be a separate crate, right?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants