Skip to content

Commit 18b2921

Browse files
committed
fix: into_index_worktree_iter() now takes an iterator, instead of a Vec.
This makes the API more consistent, and one can pass `None` as well.
1 parent 719ced8 commit 18b2921

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

gix/src/status/index_worktree.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,10 @@ pub mod iter {
611611
///
612612
/// * `patterns`
613613
/// - Optional patterns to use to limit the paths to look at. If empty, all paths are considered.
614-
pub fn into_index_worktree_iter(self, patterns: Vec<BString>) -> Result<index_worktree::Iter, Error> {
614+
pub fn into_index_worktree_iter(
615+
self,
616+
patterns: impl IntoIterator<Item = BString>,
617+
) -> Result<index_worktree::Iter, Error> {
615618
let index = match self.index {
616619
None => IndexPersistedOrInMemory::Persisted(self.repo.index_or_empty()?),
617620
Some(index) => index,
@@ -632,6 +635,7 @@ pub mod iter {
632635
{
633636
let (tx, rx) = std::sync::mpsc::channel();
634637
let mut collect = Collect { tx };
638+
let patterns: Vec<_> = patterns.into_iter().collect();
635639
let join = std::thread::Builder::new()
636640
.name("gix::status::index_worktree::iter::producer".into())
637641
.spawn({

0 commit comments

Comments
 (0)