From f969bec2c006b3cbaad89cd093b8201eb98780ff Mon Sep 17 00:00:00 2001 From: Ed Page Date: Fri, 16 Aug 2024 09:38:40 -0500 Subject: [PATCH] feat(complete): Add Shells::iter Didn't add an `IntoIterator` because I didn't want to bother writing an opaque iterator type --- clap_complete/src/dynamic/env/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/clap_complete/src/dynamic/env/mod.rs b/clap_complete/src/dynamic/env/mod.rs index eb5b28a8d27..a54e72b6295 100644 --- a/clap_complete/src/dynamic/env/mod.rs +++ b/clap_complete/src/dynamic/env/mod.rs @@ -245,6 +245,11 @@ impl<'s> Shells<'s> { pub fn names(&self) -> impl Iterator + 's { self.0.iter().map(|c| c.name()) } + + /// Iterate over [`EnvCompleter`]s + pub fn iter(&self) -> impl Iterator { + self.0.iter().copied() + } } /// Shell-integration for completions