From 8025135842457a2a814bf2016b0e8b71d0b076e4 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 9 Jul 2021 08:04:27 +0100 Subject: [PATCH 1/3] Add index getter to Variant --- src/ty/variant.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ty/variant.rs b/src/ty/variant.rs index 1c92c2b6..5ae7f45a 100644 --- a/src/ty/variant.rs +++ b/src/ty/variant.rs @@ -230,6 +230,11 @@ where &self.fields } + /// Returns the index of the variant. + pub fn index(&self) -> Option { + self.index + } + /// Returns the discriminant of the variant. pub fn discriminant(&self) -> Option { self.discriminant From 98578995f7baf250dbc6d994c48b999ea1c80754 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 9 Jul 2021 08:06:30 +0100 Subject: [PATCH 2/3] Update comment. --- src/ty/variant.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ty/variant.rs b/src/ty/variant.rs index 5ae7f45a..c3479c32 100644 --- a/src/ty/variant.rs +++ b/src/ty/variant.rs @@ -230,7 +230,7 @@ where &self.fields } - /// Returns the index of the variant. + /// Returns the index of the variant, if specified. pub fn index(&self) -> Option { self.index } From e6f160fc40a09d0f7c698e049875c2e693c12578 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 9 Jul 2021 09:23:45 +0100 Subject: [PATCH 3/3] Update release notes and CHANGELOG --- CHANGELOG.md | 6 ++++++ Cargo.toml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) 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"