From e22842f5dbfaaf0a6a1207775129384ca92c8cda Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 31 Aug 2022 15:07:29 -0600 Subject: [PATCH] chore: bump enum-iterator from 0.8.1 to 1.2.0 (#27496) * chore: bump enum-iterator from 0.8.1 to 1.2.0 Bumps [enum-iterator](https://github.com/stephaneyfx/enum-iterator) from 0.8.1 to 1.2.0. - [Release notes](https://github.com/stephaneyfx/enum-iterator/releases) - [Commits](https://github.com/stephaneyfx/enum-iterator/compare/0.8.1...1.2.0) --- updated-dependencies: - dependency-name: enum-iterator dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Make versions consistent, and a-z toml * Accommodate new apis Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tyera Eulberg --- Cargo.lock | 8 ++++---- program-runtime/Cargo.toml | 2 +- program-runtime/src/timings.rs | 10 +++++----- programs/bpf/Cargo.lock | 8 ++++---- storage-bigtable/Cargo.toml | 2 +- storage-bigtable/src/compression.rs | 6 +++--- storage-proto/Cargo.toml | 2 +- storage-proto/build.rs | 4 ++-- storage-proto/src/convert.rs | 6 +++--- 9 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5158a8bea..b1ffe471b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1367,18 +1367,18 @@ dependencies = [ [[package]] name = "enum-iterator" -version = "0.8.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2953d1df47ac0eb70086ccabf0275aa8da8591a28bd358ee2b52bd9f9e3ff9e9" +checksum = "91a4ec26efacf4aeff80887a175a419493cb6f8b5480d26387eb0bd038976187" dependencies = [ "enum-iterator-derive", ] [[package]] name = "enum-iterator-derive" -version = "0.8.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8958699f9359f0b04e691a13850d48b7de329138023876d07cbd024c2c820598" +checksum = "828de45d0ca18782232dfb8f3ea9cc428e8ced380eb26a520baaacfc70de39ce" dependencies = [ "proc-macro2 1.0.41", "quote 1.0.18", diff --git a/program-runtime/Cargo.toml b/program-runtime/Cargo.toml index 27e5c1175..ae2faa4a2 100644 --- a/program-runtime/Cargo.toml +++ b/program-runtime/Cargo.toml @@ -13,6 +13,7 @@ edition = "2021" base64 = "0.13" bincode = "1.3.3" eager = "0.1.0" +enum-iterator = "1.2.0" itertools = "0.10.1" libc = "0.2.101" libloading = "0.7.0" @@ -26,7 +27,6 @@ solana-measure = { path = "../measure", version = "=1.12.0" } solana-metrics = { path = "../metrics", version = "=1.12.0" } solana-sdk = { path = "../sdk", version = "=1.12.0" } thiserror = "1.0" -enum-iterator = "0.8.1" [dev-dependencies] solana-logger = { path = "../logger", version = "=1.12.0" } diff --git a/program-runtime/src/timings.rs b/program-runtime/src/timings.rs index 8e63dfabf..c61d8e260 100644 --- a/program-runtime/src/timings.rs +++ b/program-runtime/src/timings.rs @@ -1,6 +1,6 @@ use { core::fmt, - enum_iterator::IntoEnumIterator, + enum_iterator::Sequence, solana_sdk::{clock::Slot, pubkey::Pubkey, saturating_add_assign}, std::{ collections::HashMap, @@ -40,7 +40,7 @@ impl ProgramTiming { } /// Used as an index for `Metrics`. -#[derive(Debug, IntoEnumIterator)] +#[derive(Debug, Sequence)] pub enum ExecuteTimingType { CheckUs, LoadUs, @@ -53,7 +53,7 @@ pub enum ExecuteTimingType { UpdateTransactionStatuses, } -pub struct Metrics([u64; ExecuteTimingType::ITEM_COUNT]); +pub struct Metrics([u64; ExecuteTimingType::CARDINALITY]); impl Index for Metrics { type Output = u64; @@ -70,7 +70,7 @@ impl IndexMut for Metrics { impl Default for Metrics { fn default() -> Self { - Metrics([0; ExecuteTimingType::ITEM_COUNT]) + Metrics([0; ExecuteTimingType::CARDINALITY]) } } @@ -337,7 +337,7 @@ impl ExecuteTimings { let idx = timing_type as usize; match self.metrics.0.get_mut(idx) { Some(elem) => *elem = elem.saturating_add(value_to_add), - None => debug_assert!(idx < ExecuteTimingType::ITEM_COUNT, "Index out of bounds"), + None => debug_assert!(idx < ExecuteTimingType::CARDINALITY, "Index out of bounds"), } } } diff --git a/programs/bpf/Cargo.lock b/programs/bpf/Cargo.lock index 648568f12..aae25cffa 100644 --- a/programs/bpf/Cargo.lock +++ b/programs/bpf/Cargo.lock @@ -1188,18 +1188,18 @@ dependencies = [ [[package]] name = "enum-iterator" -version = "0.8.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2953d1df47ac0eb70086ccabf0275aa8da8591a28bd358ee2b52bd9f9e3ff9e9" +checksum = "91a4ec26efacf4aeff80887a175a419493cb6f8b5480d26387eb0bd038976187" dependencies = [ "enum-iterator-derive", ] [[package]] name = "enum-iterator-derive" -version = "0.8.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8958699f9359f0b04e691a13850d48b7de329138023876d07cbd024c2c820598" +checksum = "828de45d0ca18782232dfb8f3ea9cc428e8ced380eb26a520baaacfc70de39ce" dependencies = [ "proc-macro2 1.0.41", "quote 1.0.18", diff --git a/storage-bigtable/Cargo.toml b/storage-bigtable/Cargo.toml index 0958288e3..3eff63440 100644 --- a/storage-bigtable/Cargo.toml +++ b/storage-bigtable/Cargo.toml @@ -14,7 +14,7 @@ backoff = { version = "0.4.0", features = ["tokio"] } bincode = "1.3.3" bytes = "1.2" bzip2 = "0.4.3" -enum-iterator = "0.8.1" +enum-iterator = "1.2.0" flate2 = "1.0.24" futures = "0.3.23" goauth = "0.13.1" diff --git a/storage-bigtable/src/compression.rs b/storage-bigtable/src/compression.rs index a2e5bda94..90b8ccbe0 100644 --- a/storage-bigtable/src/compression.rs +++ b/storage-bigtable/src/compression.rs @@ -1,9 +1,9 @@ use { - enum_iterator::IntoEnumIterator, + enum_iterator::{all, Sequence}, std::io::{self, BufReader, Read, Write}, }; -#[derive(Debug, Serialize, Deserialize, IntoEnumIterator)] +#[derive(Debug, Serialize, Deserialize, Sequence)] pub enum CompressionMethod { NoCompression, Bzip2, @@ -76,7 +76,7 @@ pub fn compress(method: CompressionMethod, data: &[u8]) -> Result, io::E pub fn compress_best(data: &[u8]) -> Result, io::Error> { let mut candidates = vec![]; - for method in CompressionMethod::into_enum_iter() { + for method in all::() { candidates.push(compress(method, data)?); } diff --git a/storage-proto/Cargo.toml b/storage-proto/Cargo.toml index 7c179ff0a..2c8bfb7e8 100644 --- a/storage-proto/Cargo.toml +++ b/storage-proto/Cargo.toml @@ -19,7 +19,7 @@ solana-sdk = { path = "../sdk", version = "=1.12.0" } solana-transaction-status = { path = "../transaction-status", version = "=1.12.0" } [dev-dependencies] -enum-iterator = "0.8.1" +enum-iterator = "1.2.0" [lib] crate-type = ["lib"] diff --git a/storage-proto/build.rs b/storage-proto/build.rs index ec975a105..25954b1b8 100644 --- a/storage-proto/build.rs +++ b/storage-proto/build.rs @@ -19,11 +19,11 @@ fn main() -> Result<(), std::io::Error> { .build_server(false) .type_attribute( "TransactionErrorType", - "#[cfg_attr(test, derive(enum_iterator::IntoEnumIterator))]", + "#[cfg_attr(test, derive(enum_iterator::Sequence))]", ) .type_attribute( "InstructionErrorType", - "#[cfg_attr(test, derive(enum_iterator::IntoEnumIterator))]", + "#[cfg_attr(test, derive(enum_iterator::Sequence))]", ) .compile(&protos, &[proto_base_path]) } diff --git a/storage-proto/src/convert.rs b/storage-proto/src/convert.rs index 399a3eb99..d7a9bcdd3 100644 --- a/storage-proto/src/convert.rs +++ b/storage-proto/src/convert.rs @@ -1118,7 +1118,7 @@ impl TryFrom for Vec { #[cfg(test)] mod test { - use {super::*, enum_iterator::IntoEnumIterator}; + use {super::*, enum_iterator::all}; #[test] fn test_reward_type_encode() { @@ -1744,7 +1744,7 @@ mod test { fn test_error_enums() { let ix_index = 1; let custom_error = 42; - for error in tx_by_addr::TransactionErrorType::into_enum_iter() { + for error in all::() { match error { tx_by_addr::TransactionErrorType::DuplicateInstruction | tx_by_addr::TransactionErrorType::InsufficientFundsForRent => { @@ -1762,7 +1762,7 @@ mod test { assert_eq!(tx_by_addr_error, transaction_error.into()); } tx_by_addr::TransactionErrorType::InstructionError => { - for ix_error in tx_by_addr::InstructionErrorType::into_enum_iter() { + for ix_error in all::() { if ix_error != tx_by_addr::InstructionErrorType::Custom { let tx_by_addr_error = tx_by_addr::TransactionError { transaction_error: error as i32,