Skip to content

Instantly share code, notes, and snippets.

@maurer
Forked from anonymous/playground.rs
Created February 19, 2018 20:37
Show Gist options
  • Save maurer/5369c9e7c313ecbefc25007212f3053e to your computer and use it in GitHub Desktop.
Save maurer/5369c9e7c313ecbefc25007212f3053e to your computer and use it in GitHub Desktop.
Rust code shared from the playground
/// Retrieve a list of new files to be copied to the DMS.
pub fn added_files<'a>(local: &'a BTreeSet<LibraryFile>, dms: &'a BTreeSet<LibraryFile>) ->
Vec<&'a LibraryFile> {
local.difference(dms).collect()
}
/// Retrieve a list of new files to be copied to the DMS.
pub fn added_files<'a>(local: &'a BTreeSet<LibraryFile>, dms: &'a BTreeSet<LibraryFile>) ->
Box<Iterator<Item=&'a LibraryFile>> {
Box::new(local.difference(dms)) as Box<Iterator<Item=&'a LibraryFile>>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment