-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DAGJson support for Ipld #390
Conversation
So pr is blocked by breaking changes in rust-fil-proofs being updated, but also could be some functional changes depending on what happens with ipld/specs#259 Isn't a big rush to get this in so can probably wait for that to resolve |
/// | ||
/// ``` | ||
/// # use forest_ipld::ipld; | ||
/// let v = ipld!(null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels weird having a doc test for how to use an Enum... Just adds to test compilation and running without much value. Your documentation of the macro is pretty good already
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made more sense to me to document how to construct each variant instead of doing all on the Ipld enum. These are pretty lightweight but I can add no_run
to them or remove, just nice to have examples for each variant for practical use imo.
@@ -44,7 +117,10 @@ pub fn from_ipld<T>(value: &Ipld) -> Result<T, String> | |||
where | |||
T: DeserializeOwned, | |||
{ | |||
// TODO find a way to convert without going through byte buffer | |||
// TODO update to not go through byte buffer to convert |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is so janky its funny. But agree we dont need to fix this yet haha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, it's not THAT janky, not like it's a common concept to be able to go from a generalized type to a specific one without a buffer usually. This is correct, just not efficient
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely correct, not questioning. I just think its funny how we have to go to CBOR first then deserialize. Anyways, nothing needs to be fixed here.
Summary of changes
Changes introduced in this pull request:
Also added the ipld! macro for fun (makes things a lot easier)
Reference issue to close (if applicable)
Closes
Other information and links