Skip to content

Commit

Permalink
fix: into_index_worktree_iter() now takes an iterator, instead of a…
Browse files Browse the repository at this point in the history
… Vec.

This makes the API more consistent, and one can pass `None`
as well.
  • Loading branch information
Byron committed Apr 3, 2024
1 parent 719ced8 commit 18b2921
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gix/src/status/index_worktree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,10 @@ pub mod iter {
///
/// * `patterns`
/// - Optional patterns to use to limit the paths to look at. If empty, all paths are considered.
pub fn into_index_worktree_iter(self, patterns: Vec<BString>) -> Result<index_worktree::Iter, Error> {
pub fn into_index_worktree_iter(
self,
patterns: impl IntoIterator<Item = BString>,
) -> Result<index_worktree::Iter, Error> {
let index = match self.index {
None => IndexPersistedOrInMemory::Persisted(self.repo.index_or_empty()?),
Some(index) => index,
Expand All @@ -632,6 +635,7 @@ pub mod iter {
{
let (tx, rx) = std::sync::mpsc::channel();
let mut collect = Collect { tx };
let patterns: Vec<_> = patterns.into_iter().collect();
let join = std::thread::Builder::new()
.name("gix::status::index_worktree::iter::producer".into())
.spawn({
Expand Down

0 comments on commit 18b2921

Please sign in to comment.