bump version to 2.0.1 (#760)

This commit is contained in:
Lena Hellström 2025-03-10 19:27:15 +01:00 committed by GitHub
parent ee23e86743
commit 7610408399
6 changed files with 27 additions and 27 deletions

View File

@ -3,7 +3,7 @@ members = ["derive", "compatibility"]
[package] [package]
name = "bincode" name = "bincode"
version = "2.0.0" # remember to update html_root_url and bincode_derive version = "2.0.1" # remember to update html_root_url and bincode_derive
authors = [ authors = [
"Ty Overby <ty@pre-alpha.com>", "Ty Overby <ty@pre-alpha.com>",
"Zoey Riordan <zoey@dos.cafe>", "Zoey Riordan <zoey@dos.cafe>",
@ -32,7 +32,7 @@ alloc = ["serde?/alloc"]
derive = ["bincode_derive"] derive = ["bincode_derive"]
[dependencies] [dependencies]
bincode_derive = { path = "derive", version = "2.0.0", optional = true } bincode_derive = { path = "derive", version = "2.0.1", optional = true }
serde = { version = "1.0", default-features = false, optional = true } serde = { version = "1.0", default-features = false, optional = true }
unty = "0.0.4" unty = "0.0.4"

View File

@ -1,6 +1,6 @@
[package] [package]
name = "bincode_derive" name = "bincode_derive"
version = "2.0.0" # remember to update bincode version = "2.0.1" # remember to update bincode
authors = [ authors = [
"Zoey Riordan <zoey@dos.cafe>", "Zoey Riordan <zoey@dos.cafe>",
"Victor Koenders <bincode@trangar.com>", "Victor Koenders <bincode@trangar.com>",

View File

@ -4,7 +4,7 @@ Bincode 2 now has an optional dependency on `serde`. You can either use `serde`,
## From `Options` to `Configuration` ## From `Options` to `Configuration`
Bincode 1 had the [Options](https://docs.rs/bincode/1/bincode/config/trait.Options.html) trait. This has been replaced with the [Configuration](https://docs.rs/bincode/2.0.0/bincode/config/struct.Configuration.html) struct. Bincode 1 had the [Options](https://docs.rs/bincode/1/bincode/config/trait.Options.html) trait. This has been replaced with the [Configuration](https://docs.rs/bincode/2/bincode/config/struct.Configuration.html) struct.
If you're using `Options`, you can change it like this: If you're using `Options`, you can change it like this:
@ -46,10 +46,10 @@ If so, make sure to include bincode 2 with the `serde` feature enabled, and use
```toml ```toml
[dependencies] [dependencies]
bincode = { version = "2.0.0", features = ["serde"] } bincode = { version = "2.0", features = ["serde"] }
# Optionally you can disable the `derive` feature: # Optionally you can disable the `derive` feature:
# bincode = { version = "2.0.0", default-features = false, features = ["std", "serde"] } # bincode = { version = "2.0", default-features = false, features = ["std", "serde"] }
``` ```
Then replace the following functions: (`Configuration` is `bincode::config::legacy()` by default) Then replace the following functions: (`Configuration` is `bincode::config::legacy()` by default)
@ -70,13 +70,13 @@ Then replace the following functions: (`Configuration` is `bincode::config::lega
```toml,ignore ```toml,ignore
[dependencies] [dependencies]
bincode = "2.0.0" bincode = "2.0"
# If you need `no_std` with `alloc`: # If you need `no_std` with `alloc`:
# bincode = { version = "2.0.0", default-features = false, features = ["derive", "alloc"] } # bincode = { version = "2.0", default-features = false, features = ["derive", "alloc"] }
# If you need `no_std` and no `alloc`: # If you need `no_std` and no `alloc`:
# bincode = { version = "2.0.0", default-features = false, features = ["derive"] } # bincode = { version = "2.0", default-features = false, features = ["derive"] }
``` ```
Replace or add the following attributes. You are able to use both `serde-derive` and `bincode-derive` side-by-side. Replace or add the following attributes. You are able to use both `serde-derive` and `bincode-derive` side-by-side.
@ -86,7 +86,7 @@ Replace or add the following attributes. You are able to use both `serde-derive`
| `#[derive(serde::Serialize)]` | `#[derive(bincode::Encode)]` | | `#[derive(serde::Serialize)]` | `#[derive(bincode::Encode)]` |
| `#[derive(serde::Deserialize)]` | `#[derive(bincode::Decode)]` | | `#[derive(serde::Deserialize)]` | `#[derive(bincode::Decode)]` |
**note:** To implement these traits manually, see the documentation of [Encode](https://docs.rs/bincode/2.0.0/bincode/enc/trait.Encode.html) and [Decode](https://docs.rs/bincode/2.0.0/bincode/de/trait.Decode.html). **note:** To implement these traits manually, see the documentation of [Encode](https://docs.rs/bincode/2/bincode/enc/trait.Encode.html) and [Decode](https://docs.rs/bincode/2/bincode/de/trait.Decode.html).
**note:** For more information on using `bincode-derive` with external libraries, see [below](#bincode-derive-and-libraries). **note:** For more information on using `bincode-derive` with external libraries, see [below](#bincode-derive-and-libraries).
@ -107,10 +107,10 @@ Then replace the following functions: (`Configuration` is `bincode::config::lega
Currently not many libraries support the traits `Encode` and `Decode`. There are a couple of options if you want to use `#[derive(bincode::Encode, bincode::Decode)]`: Currently not many libraries support the traits `Encode` and `Decode`. There are a couple of options if you want to use `#[derive(bincode::Encode, bincode::Decode)]`:
- Enable the `serde` feature and add a `#[bincode(with_serde)]` above each field that implements `serde::Serialize/Deserialize` but not `Encode/Decode` - Enable the `serde` feature and add a `#[bincode(with_serde)]` above each field that implements `serde::Serialize/Deserialize` but not `Encode/Decode`
- Enable the `serde` feature and wrap your field in [bincode::serde::Compat](https://docs.rs/bincode/2.0.0/bincode/serde/struct.Compat.html) or [bincode::serde::BorrowCompat](https://docs.rs/bincode/2.0.0/bincode/serde/struct.BorrowCompat.html) - Enable the `serde` feature and wrap your field in [bincode::serde::Compat](https://docs.rs/bincode/2/bincode/serde/struct.Compat.html) or [bincode::serde::BorrowCompat](https://docs.rs/bincode/2/bincode/serde/struct.BorrowCompat.html)
- Make a pull request to the library: - Make a pull request to the library:
- Make sure to be respectful, most of the developers are doing this in their free time. - Make sure to be respectful, most of the developers are doing this in their free time.
- Add a dependency `bincode = { version = "2.0.0", default-features = false, optional = true }` to the `Cargo.toml` - Add a dependency `bincode = { version = "2.0", default-features = false, optional = true }` to the `Cargo.toml`
- Implement [Encode](https://docs.rs/bincode/2.0.0/bincode/enc/trait.Encode.html) - Implement [Encode](https://docs.rs/bincode/2/bincode/enc/trait.Encode.html)
- Implement [Decode](https://docs.rs/bincode/2.0.0/bincode/de/trait.Decode.html) - Implement [Decode](https://docs.rs/bincode/2/bincode/de/trait.Decode.html)
- Make sure both of these implementations have a `#[cfg(feature = "bincode")]` attribute. - Make sure both of these implementations have a `#[cfg(feature = "bincode")]` attribute.

View File

@ -15,8 +15,8 @@ By default, this serialization format uses little-endian byte order for basic nu
Endianness can be configured with the following methods, allowing for big-endian serialization when required: Endianness can be configured with the following methods, allowing for big-endian serialization when required:
- [`with_big_endian`](https://docs.rs/bincode/2.0.0/bincode/config/struct.Configuration.html#method.with_big_endian) - [`with_big_endian`](https://docs.rs/bincode/2/bincode/config/struct.Configuration.html#method.with_big_endian)
- [`with_little_endian`](https://docs.rs/bincode/2.0.0/bincode/config/struct.Configuration.html#method.with_little_endian) - [`with_little_endian`](https://docs.rs/bincode/2/bincode/config/struct.Configuration.html#method.with_little_endian)
### Byte Order Considerations ### Byte Order Considerations
@ -31,7 +31,7 @@ Endianness can be configured with the following methods, allowing for big-endian
- Encoded as a single byte - Encoded as a single byte
- `false` is represented by `0` - `false` is represented by `0`
- `true` is represented by `1` - `true` is represented by `1`
- During deserialization, values other than 0 and 1 will result in an error [`DecodeError::InvalidBooleanValue`](https://docs.rs/bincode/2.0.0/bincode/error/enum.DecodeError.html#variant.InvalidBooleanValue) - During deserialization, values other than 0 and 1 will result in an error [`DecodeError::InvalidBooleanValue`](https://docs.rs/bincode/2/bincode/error/enum.DecodeError.html#variant.InvalidBooleanValue)
### Numeric Types ### Numeric Types
@ -62,7 +62,7 @@ Endianness can be configured with the following methods, allowing for big-endian
- Surrogate code points (0xD800 to 0xDFFF) are not valid - Surrogate code points (0xD800 to 0xDFFF) are not valid
- Invalid Unicode characters can be acquired via unsafe code, this is handled as: - Invalid Unicode characters can be acquired via unsafe code, this is handled as:
- during serialization: data is written as-is - during serialization: data is written as-is
- during deserialization: an error is raised [`DecodeError::InvalidCharEncoding`](https://docs.rs/bincode/2.0.0/bincode/error/enum.DecodeError.html#variant.InvalidCharEncoding) - during deserialization: an error is raised [`DecodeError::InvalidCharEncoding`](https://docs.rs/bincode/2/bincode/error/enum.DecodeError.html#variant.InvalidCharEncoding)
- No additional metadata or encoding scheme beyond the raw code point value - No additional metadata or encoding scheme beyond the raw code point value
All tuples have no additional bytes, and are encoded in their specified order, e.g. All tuples have no additional bytes, and are encoded in their specified order, e.g.
@ -92,7 +92,7 @@ Encoding an unsigned integer v (of any type excepting u8/i8) works as follows:
`usize` is being encoded/decoded as a `u64` and `isize` is being encoded/decoded as a `i64`. `usize` is being encoded/decoded as a `u64` and `isize` is being encoded/decoded as a `i64`.
See the documentation of [VarintEncoding](https://docs.rs/bincode/2.0.0/bincode/config/struct.Configuration.html#method.with_variable_int_encoding) for more information. See the documentation of [VarintEncoding](https://docs.rs/bincode/2/bincode/config/struct.Configuration.html#method.with_variable_int_encoding) for more information.
### FixintEncoding ### FixintEncoding
@ -100,7 +100,7 @@ See the documentation of [VarintEncoding](https://docs.rs/bincode/2.0.0/bincode/
- Enum discriminants are encoded as u32 - Enum discriminants are encoded as u32
- Lengths and usize are encoded as u64 - Lengths and usize are encoded as u64
See the documentation of [FixintEncoding](https://docs.rs/bincode/2.0.0/bincode/config/struct.Configuration.html#method.with_fixed_int_encoding) for more information. See the documentation of [FixintEncoding](https://docs.rs/bincode/2/bincode/config/struct.Configuration.html#method.with_fixed_int_encoding) for more information.
## Enums ## Enums
@ -224,7 +224,7 @@ assert_eq!(encoded.as_slice(), &[
- During serialization, the string is encoded as a sequence of the given bytes. - During serialization, the string is encoded as a sequence of the given bytes.
- Rust strings are UTF-8 encoded by default, but this is not enforced by bincode - Rust strings are UTF-8 encoded by default, but this is not enforced by bincode
- No normalization or transformation of text - No normalization or transformation of text
- If an invalid UTF-8 sequence is encountered during decoding, an [`DecodeError::Utf8`](https://docs.rs/bincode/2.0.0/bincode/error/enum.DecodeError.html#variant.Utf8) error is raised - If an invalid UTF-8 sequence is encountered during decoding, an [`DecodeError::Utf8`](https://docs.rs/bincode/2/bincode/error/enum.DecodeError.html#variant.Utf8) error is raised
```rust ```rust
let str = "Hello 🌍"; // Mixed ASCII and Unicode let str = "Hello 🌍"; // Mixed ASCII and Unicode

10
fuzz/Cargo.lock generated
View File

@ -19,7 +19,7 @@ dependencies = [
[[package]] [[package]]
name = "bincode" name = "bincode"
version = "2.0.0" version = "2.0.1"
dependencies = [ dependencies = [
"bincode_derive", "bincode_derive",
"serde", "serde",
@ -31,14 +31,14 @@ name = "bincode-fuzz"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"bincode 1.3.3", "bincode 1.3.3",
"bincode 2.0.0", "bincode 2.0.1",
"libfuzzer-sys", "libfuzzer-sys",
"serde", "serde",
] ]
[[package]] [[package]]
name = "bincode_derive" name = "bincode_derive"
version = "2.0.0" version = "2.0.1"
dependencies = [ dependencies = [
"virtue", "virtue",
] ]
@ -123,9 +123,9 @@ checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
[[package]] [[package]]
name = "unty" name = "unty"
version = "0.0.3" version = "0.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1a88342087869553c259588a3ec9ca73ce9b2d538b7051ba5789ff236b6c129" checksum = "6d49784317cd0d1ee7ec5c716dd598ec5b4483ea832a2dced265471cc0f690ae"
[[package]] [[package]]
name = "virtue" name = "virtue"

View File

@ -71,7 +71,7 @@
//! [`net::TcpStream`]: std::net::TcpStream //! [`net::TcpStream`]: std::net::TcpStream
//! //!
#![doc(html_root_url = "https://docs.rs/bincode/2.0.0")] #![doc(html_root_url = "https://docs.rs/bincode/2.0.1")]
#![crate_name = "bincode"] #![crate_name = "bincode"]
#![crate_type = "rlib"] #![crate_type = "rlib"]