diff --git a/hubble/src/cli.rs b/hubble/src/cli.rs index 198aa676ad..827517208a 100644 --- a/hubble/src/cli.rs +++ b/hubble/src/cli.rs @@ -17,7 +17,20 @@ pub struct Args { pub secret: String, /// Indexer configurations to start. #[arg(short, long, env = "HUBBLE_INDEXERS")] - pub indexers: Vec, + pub indexers: Indexers, +} + +#[derive(Clone, Debug, serde::Deserialize)] +pub struct Indexers(Vec); + +impl IntoIterator for Indexers { + type Item = IndexerConfig; + + type IntoIter = std::vec::IntoIter; + + fn into_iter(self) -> Self::IntoIter { + self.0.into_iter() + } } #[derive(Clone, Debug, serde::Deserialize)] @@ -34,7 +47,7 @@ impl IndexerConfig { } } -impl FromStr for IndexerConfig { +impl FromStr for Indexers { type Err = color_eyre::eyre::Error; fn from_str(item: &str) -> Result::Err> {