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

Release v0.11.0 #127

Merged
merged 4 commits into from
Aug 25, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.11.0] - 2021-08-25
### Added
- Add type parameter getters [(#122)](https://github.com/paritytech/scale-info/pull/122)
- Add support for Range and RangeInclusive [(#124)](https://github.com/paritytech/scale-info/pull/124), [(#126)](https://github.com/paritytech/scale-info/pull/126)

## [0.10.0] - 2021-07-29
### Added
- Add capture_docs attribute [(#118)](https://github.com/paritytech/scale-info/pull/118)
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "scale-info"
version = "0.10.0"
version = "0.11.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

Expand Down
6 changes: 3 additions & 3 deletions src/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,14 @@ pub enum TypeDef<T: Form = MetaForm> {
Array(TypeDefArray<T>),
/// A tuple type.
Tuple(TypeDefTuple<T>),
/// A Range type.
Range(TypeDefRange<T>),
/// A Rust primitive type.
Primitive(TypeDefPrimitive),
/// A type using the [`Compact`] encoding
Compact(TypeDefCompact<T>),
/// A type representing a sequence of bits.
BitSequence(TypeDefBitSequence<T>),
/// A Range type.
Range(TypeDefRange<T>),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh good point. Do you mind mentioning this in the docs as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That it is backwards compatible, or that new variants should be added to the end?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latter. Something like "Tooling relying on scale-info data generally relies on order to find items. For this reason it is important that public enums add new variants items to the end to ensure backwards compatibility"?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've gone a step further and added explicit indices for this and TypeDefPrimitive, in case people delete or reorder variants.

}

impl IntoPortable for TypeDef {
Expand All @@ -267,10 +267,10 @@ impl IntoPortable for TypeDef {
TypeDef::Sequence(sequence) => sequence.into_portable(registry).into(),
TypeDef::Array(array) => array.into_portable(registry).into(),
TypeDef::Tuple(tuple) => tuple.into_portable(registry).into(),
TypeDef::Range(range) => range.into_portable(registry).into(),
TypeDef::Primitive(primitive) => primitive.into(),
TypeDef::Compact(compact) => compact.into_portable(registry).into(),
TypeDef::BitSequence(bitseq) => bitseq.into_portable(registry).into(),
TypeDef::Range(range) => range.into_portable(registry).into(),
}
}
}
Expand Down