Conversation
|
btw I'm probably in favor of doing our own serialization for metadata and strings, there seem to be differences between msgpack libraries in how they handle enums for example, so I'd like to avoid potential issues there |
what about having metadata and strings table being just chunks instead of dedicated fields? |
Sure, I don't think it should cause too much trouble for the user |
|
@moonshadow565 @alanpq starting this up again |
Been thinking about it, no need to overcomplicate it. |
|
+1 on the binrw/etc usage, since we own both sides we might as well keep it as boilerplate free as possible |
d42cd18 to
bec2a9b
Compare
|
@Crauzer @moonshadow565 few breaking changes with the binrw port:
Non-breaking but I've also added proptest for checking the soundness of |
|
|
||
| impl ModpkgMetadata { | ||
| /// The total size of the metadata when written to bytes. | ||
| pub fn size(&self) -> usize { |
There was a problem hiding this comment.
There should be better way to do this with binrw
There was a problem hiding this comment.
As far as I know, we either do this or we use some custom String struct that impls BinWrite/Read (or we ask binrw to implement mapping inside an option somehow)
There was a problem hiding this comment.
Why not just implement dummy Write that tracks the size and write metdata into it?
There was a problem hiding this comment.
Github mobile lied to me, thought this was a comment on the optional_string_write map stuff. There probably is a better way I just ported what already was there - I'll let @Crauzer decide what to replace it with
There was a problem hiding this comment.
Honestly, I don't even see the point of this function existing now that we're using binrw. I think we can remove it. If needed, we can add it back using some other way as moon said.
|
|
||
| impl ModpkgAuthor { | ||
| /// The total size of the author when written to bytes. | ||
| pub fn size(&self) -> usize { |
26ad6cb to
4e71cc5
Compare
|
Going to merge this as it is, we can further refine the format as needed while I work on the mod project packer. |
Uh oh!
There was an error while loading. Please reload this page.