Skip to content

Commit

Permalink
feat(complete): Add Shells::iter
Browse files Browse the repository at this point in the history
Didn't add an `IntoIterator` because I didn't want to bother writing an
opaque iterator type
  • Loading branch information
epage committed Aug 16, 2024
1 parent 661ccc2 commit f969bec
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions clap_complete/src/dynamic/env/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,11 @@ impl<'s> Shells<'s> {
pub fn names(&self) -> impl Iterator<Item = &'static str> + 's {
self.0.iter().map(|c| c.name())
}

/// Iterate over [`EnvCompleter`]s
pub fn iter(&self) -> impl Iterator<Item = &dyn EnvCompleter> {
self.0.iter().copied()
}
}

/// Shell-integration for completions
Expand Down

0 comments on commit f969bec

Please sign in to comment.