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

Export decode_vec_with_len #403

Merged
merged 3 commits into from
Jan 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,27 @@ All notable changes to this crate are documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this crate adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.3.0]

This release exports `decode_vec_with_len` to support custom decoding of `Vec`s.

### Added

- Export `decode_vec_with_len`.

## [3.2.1] - 2022-09-14

This release fixes compilation on no-std envs.

## Changed
### Changed

- Use core RangeInclusive instead of std [#378](https://github.com/paritytech/parity-scale-codec/pull/378)

## [3.2.0] - 2022-09-13

This release (specifically [#375](https://github.com/paritytech/parity-scale-codec/pull/375)) bumps the MSRV to 1.60.0 as it depends on the Cargo.toml weak dependency feature.

## Changed
### Changed

- Don't include bitvec with std feature unless asked for explicitly. [#375](https://github.com/paritytech/parity-scale-codec/pull/375)
- Implement `MaxEncodedLen` on more core lib types. [#350](https://github.com/paritytech/parity-scale-codec/pull/350)
Expand All @@ -26,13 +34,13 @@ This release (specifically [#375](https://github.com/paritytech/parity-scale-cod

A quick release to fix an issue introduced in 3.1.4 that broke compiling on no-std.

## Changed
### Changed

- Fix compiling on no-std. (see https://github.com/paritytech/parity-scale-codec/commit/c25f14a46546c75e4208363ced9d89aa81c85e7f)

## [3.1.3] - 2022-06-10

## Changed
### Changed

- Impl `MaxEncodedLen` for `Box<T>`. [#349](https://github.com/paritytech/parity-scale-codec/pull/349)
- Add `decode_from_bytes`. [#342](https://github.com/paritytech/parity-scale-codec/pull/342)
Expand All @@ -41,7 +49,7 @@ A quick release to fix an issue introduced in 3.1.4 that broke compiling on no-s

Be aware that version 3.0.0. up to 3.1.1 contained some bugs in the `BitVec` encoder that could lead to an invalid encoding. Thus, we yanked these crate version and it is advised to upgrade to 3.1.2. Any release before 3.0.0 wasn't affected by this bug.

## Changed
### Changed

- Optimised the `Decode::decode` for `[T; N]` by @xgreenx. [#299](https://github.com/paritytech/parity-scale-codec/pull/299)
- Add some doc for the derive macro by @thiolliere. [#301](https://github.com/paritytech/parity-scale-codec/pull/301)
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "parity-scale-codec"
description = "SCALE - Simple Concatenating Aggregated Little Endians"
version = "3.2.2"
version = "3.3.0"
authors = ["Parity Technologies <admin@parity.io>"]
license = "Apache-2.0"
repository = "https://github.com/paritytech/parity-scale-codec"
Expand Down
4 changes: 2 additions & 2 deletions src/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -826,11 +826,11 @@ pub(crate) fn decode_array<I: Input, T: Decode, const N: usize>(input: &mut I) -
}
}

/// Decode the vec (without prepended the len).
/// Decode the vec (without a prepended len).
///
/// This is equivalent to decode all elements one by one, but it is optimized in some
/// situation.
pub(crate) fn decode_vec_with_len<T: Decode, I: Input>(
pub fn decode_vec_with_len<T: Decode, I: Input>(
input: &mut I,
len: usize,
) -> Result<Vec<T>, Error> {
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ mod max_encoded_len;
pub use self::error::Error;
pub use self::codec::{
Input, Output, Decode, Encode, Codec, EncodeAsRef, WrapperTypeEncode, WrapperTypeDecode,
OptionBool, DecodeLength, FullCodec, FullEncode,
OptionBool, DecodeLength, FullCodec, FullEncode, decode_vec_with_len
};
#[cfg(feature = "std")]
pub use self::codec::IoReader;
Expand Down