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] <support@github.com> * Make versions consistent, and a-z toml * Accommodate new apis Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tyera Eulberg <tyera@solana.com>
This commit is contained in:
parent
12f921386f
commit
e22842f5db
|
@ -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",
|
||||
|
|
|
@ -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" }
|
||||
|
|
|
@ -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<ExecuteTimingType> for Metrics {
|
||||
type Output = u64;
|
||||
|
@ -70,7 +70,7 @@ impl IndexMut<ExecuteTimingType> 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"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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<Vec<u8>, io::E
|
|||
|
||||
pub fn compress_best(data: &[u8]) -> Result<Vec<u8>, io::Error> {
|
||||
let mut candidates = vec![];
|
||||
for method in CompressionMethod::into_enum_iter() {
|
||||
for method in all::<CompressionMethod>() {
|
||||
candidates.push(compress(method, data)?);
|
||||
}
|
||||
|
||||
|
|
|
@ -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"]
|
||||
|
|
|
@ -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])
|
||||
}
|
||||
|
|
|
@ -1118,7 +1118,7 @@ impl TryFrom<tx_by_addr::TransactionByAddr> for Vec<TransactionByAddrInfo> {
|
|||
|
||||
#[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::<tx_by_addr::TransactionErrorType>() {
|
||||
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::<tx_by_addr::InstructionErrorType>() {
|
||||
if ix_error != tx_by_addr::InstructionErrorType::Custom {
|
||||
let tx_by_addr_error = tx_by_addr::TransactionError {
|
||||
transaction_error: error as i32,
|
||||
|
|
Loading…
Reference in New Issue