Skip to content

Commit

Permalink
Put clarifying language in migration guide regarding the serde:: and …
Browse files Browse the repository at this point in the history
…non-serde:: paths (#715)

* Put clarifying language regarding the serde:: and non-serde:: migration
paths.

* Changes to bincode::serde notes per PR discussion
  • Loading branch information
mcclure authored Aug 7, 2024
1 parent d653c39 commit d3011fe
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/migration_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ Because of confusion with `Options` defaults in bincode 1, we have made `Configu

## Migrating with `serde`

Make sure to include bincode 2 with the `serde` feature enabled.
You may wish to stick with `serde` when migrating to bincode 2, for example if you are using serde-exclusive derive features such as `#[serde(deserialize_with)]`.

If so, make sure to include bincode 2 with the `serde` feature enabled, and use the `bincode::serde::*` functions instead of `bincode::*` as described below:

```toml
[dependencies]
Expand All @@ -62,7 +64,7 @@ Then replace the following functions: (`Configuration` is `bincode::config::lega
| `bincode::serialize_into(std::io::Write, T)` | `bincode::serde::encode_into_std_write(T, std::io::Write, Configuration)` |
| `bincode::serialized_size(T)` | Currently not implemented |

## Migrating to `bincode-derive`
## Migrating from `serde` to `bincode-derive`

`bincode-derive` is enabled by default. If you're using `default-features = false`, make sure to add `features = ["derive"]` to your `Cargo.toml`.

Expand Down

0 comments on commit d3011fe

Please sign in to comment.