Giter VIP home page Giter VIP logo

msd's People

Contributors

anders429 avatar

Watchers

 avatar  avatar

msd's Issues

Treat units as nonexistant data

Currently, units are serialized as their own empty parameter (and deserialized the same way). This is redundant, as the data will always be the exact same. It also means that certain MSD files are difficult to represent (see .dwi files' #END tag, which has no parameters).

Improve `de::Error`

Currently, de::Error doesn't handle custom errors well at all. It also doesn't do well even with the serde "canonical" errors. The whole thing could probably use a bit of an overhaul to express these errors more verbosely (currently it just sets the kind to de::error::Kind::Custom, which is not super useful).

Clippy CI is not working properly

Seems that the clippy CI workflow action has not been configured properly. It runs clippy, but it doesn't actually emit any failures when clippy finds warnings.

Reduce redundant code

In the initial 0.1.0 version, a lot of code for both serialization and deserialization ended up being very similar. It would clean things up significantly to reduce code duplication, possibly by declarative macros and combining some Serializers or Deserializers together (for example, I believe there are a couple Deserializers that are just for identifiers, which could be combined into a single Deserializer).

Emit all field names for root struct

When deserializing a struct at root, all field names should be emitted, not just field names that are provided by the Deserialize implementation. This will allow ignoring of unknown fields, which currently will always cause errors.

This should only affect root structs. Structs within sequences should continue to work as they are, because the unknown tag name may be part of a field for a struct upstream or something.

Properly align enum struct variant serialization and deserialization

Enums with struct variants are serialized, but currently deserialization is not implemented for them at all. The deserialization may need to be restructured to differentiate the different valid serializations.

struct variants are allowed in serialization when serialized at any tag level, essentially. Specifically, they're currently allowed at root level and at root sequence level. This could be expanded in the future to include being allowed in struct fields.

Simplify parsing state

There are a lot of things stored in the various parsing structs that are not necessary. For example, we store starting_position, but every time a new value is requested the value is overwritten with the current value, and is never used outside of that context. The same goes for the various parsing state enums.

The parsing structs could be simplified down to a very bare-bones struct containing just bytes and position, with maybe one or two other fields if needed. A lot of the fat can be cut off here.

Consider allowing nested structs.

Nested structs could be serialized and deserialized, although it would be difficult to differentiate when an old struct ends and a new one begins when there are optional fields involved, due to there being no concept of start and end for sections in MSD. However, I think ambiguity in those situations can be worked with, given that it will increase flexibility of the data format.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.