Skip to content

Instantly share code, notes, and snippets.

@lann
Created July 14, 2023 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lann/4d9a3e3e4777b7f61e7bd7e4749d9ce5 to your computer and use it in GitHub Desktop.
Save lann/4d9a3e3e4777b7f61e7bd7e4749d9ce5 to your computer and use it in GitHub Desktop.
/// Gets the missing content of the record.
pub fn missing_content(&self) -> impl Iterator<Item = (&AnyHash, &MissingContent)> {
match &self.state {
PackageRecordState::Sourcing {
missing_content, ..
} => Box::new(missing_content.iter()) as Box<dyn Iterator<Item = _>>,
_ => Box::new(std::iter::empty()) as Box<dyn Iterator<Item = _>>,
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment