Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit 3ec6da0

Browse files
committed
Replace boxed iterator with itertools::Either
1 parent 45a1e22 commit 3ec6da0

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/api/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ warg-crypto = { workspace = true }
1111
serde = { workspace = true }
1212
serde_with = { workspace = true }
1313
thiserror = { workspace = true }
14+
itertools = { workspace = true }

crates/api/src/v1/package.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ impl PackageRecord {
8080
match &self.state {
8181
PackageRecordState::Sourcing {
8282
missing_content, ..
83-
} => Box::new(missing_content.iter()) as Box<dyn Iterator<Item = _>>,
84-
_ => Box::new(std::iter::empty()) as Box<dyn Iterator<Item = _>>,
83+
} => itertools::Either::Left(missing_content.iter()),
84+
_ => itertools::Either::Right(std::iter::empty()),
8585
}
8686
}
8787
}

0 commit comments

Comments
 (0)