Skip to content
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

Document trailing and int encoding compared to Config on Options #655

Open
junderw opened this issue Jul 23, 2023 · 2 comments
Open

Document trailing and int encoding compared to Config on Options #655

junderw opened this issue Jul 23, 2023 · 2 comments

Comments

@junderw
Copy link

junderw commented Jul 23, 2023

When switching from config() to options(), it seems that fixed int behavior switched to default to varint behavior.

The trailing and int encoding options were not present in Config, so Options documentation should mention how to configure Options in the same way as the default Config.

I understand you have moved away from Options in the newest versions... but as someone using v1 latest, trying to fix the deprecation warning caused this gotcha.

@VictorKoenders
Copy link
Contributor

We've written a small migration guide here: https://docs.rs/bincode/2.0.0-rc.2/bincode/migration_guide/index.html

Is this missing anything?

@junderw
Copy link
Author

junderw commented Jul 25, 2023

I wasn't referring to the v1 to v2 migration.

I was talking about migrating from Config to Options within the same v1.3.3 to get rid of the deprecation warnings.

I had to go digging in the source code to find the macro that implements the Config to Option conversion and see the default settings (in terms of Option) for Config.

Similar to how the config module explains the difference between Option struct and the *serialize functions and what their defaults are.

It would have been nice if the Config documentation had something similar comparing Config and Option structs in terms of the new Option's settings.

(ie. I could learn "Config was using fixint internally but you couldn't set it. So if I want the same behavior i should use fixint, which is default. cool.")

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

No branches or pull requests

2 participants