-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Tweak docs and API for shared numeric types #217
Conversation
I'm wondering if we could just get rid of |
I also wonder if we could move these two types into |
I'd be happy to not have a custom type for basic types just to get custom serialization behavior. I suppose we'd need a custom |
Once we release 1.0, any public API that exists cannot be removed without requiring us to release a new major version. Motivated by this, I would to make sure that our public API surface is reasonable concise. This PR removes a few helper methods and a few trait implementations. If it turns out that these are needed in the future, they can be added back without it being a breaking change.
b2e1269
to
3bdc179
Compare
there's maybe one simple way? both Other than those questions, does this currently look okay to you @madig? |
That could work I think, actually. It loses the correct-by-construction thing but we have to call |
it would be correct by construction, though, since we will fail to deserialize if the number is negative? |
oh I see your point. We could keep |
Yes, maybe let's replace IntegerOrFloat by a serde attribute for now (FontInfo and Kerning I guess?) and tie the existence of the other to a better idea for how to implement FontInfo? |
it's actually more annoying than I thought, because I can't get the attribute to work for the various |
Ah yes. I think you have to write serde functions for the whole type, not just the innermost part. |
I couldn't figure out how to serialize/deserialize a sequence while also providing a custom serialization function for each member. I didn't dig too deeply, but I suspect I'll have to open an issue. |
This is based off of #216, which should go in first.
Once we release 1.0, any public API that exists cannot be removed
without requiring us to release a new major version. Motivated by this,
I would to make sure that our public API surface is reasonable concise.
This PR removes a few helper methods and a few trait implementations. If
it turns out that these are needed in the future, they can be added back
without it being a breaking change.