diff --git a/CHANGELOG.md b/CHANGELOG.md index 853ce7a3..a2d192c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.9.2] - 2021-07-09 +### Added + +- Add index getter to Variant [(#110)](https://github.com/paritytech/scale-info/pull/110) + ## [0.9.1] - 2021-07-06 +### Fixed - Option constructor macro hygiene [(#108)](https://github.com/paritytech/scale-info/pull/108) diff --git a/Cargo.toml b/Cargo.toml index 52a218af..fffd641b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "scale-info" -version = "0.9.1" +version = "0.9.2" authors = ["Parity Technologies "] edition = "2018" diff --git a/src/ty/variant.rs b/src/ty/variant.rs index 1c92c2b6..c3479c32 100644 --- a/src/ty/variant.rs +++ b/src/ty/variant.rs @@ -230,6 +230,11 @@ where &self.fields } + /// Returns the index of the variant, if specified. + pub fn index(&self) -> Option { + self.index + } + /// Returns the discriminant of the variant. pub fn discriminant(&self) -> Option { self.discriminant