diff options
author | Katharina Fey <kookie@spacekookie.de> | 2020-01-10 16:37:21 +0000 |
---|---|---|
committer | Katharina Fey <kookie@spacekookie.de> | 2020-01-10 16:37:21 +0000 |
commit | 8a261eba202ec581a4af07690bc5b17ee36b869f (patch) | |
tree | 4a35665df3a41eb6ce3ff3a215a0fee6d4dc2d39 /libgitmail/src/set.rs | |
parent | bea5c01718493a1c2a4840090b596eebdafa33f0 (diff) |
Adding basic set and tree abstractions to libgitmail
Diffstat (limited to 'libgitmail/src/set.rs')
-rw-r--r-- | libgitmail/src/set.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/libgitmail/src/set.rs b/libgitmail/src/set.rs new file mode 100644 index 0000000..2c71743 --- /dev/null +++ b/libgitmail/src/set.rs @@ -0,0 +1,18 @@ +//! Various functions to work with assembled patch sets + +use crate::Patch; + +/// A set of patches that can be applied to a repo +pub struct PatchSet<'maildir> { + list: Vec<Patch<'maildir>>, +} + +impl<'maildir> PatchSet<'maildir> { + /// Consumes a PatchSet with a builder on each patch in the series + pub fn exec<F>(self, cb: F) + where + F: Fn(Patch<'maildir>), + { + self.list.into_iter().for_each(|p| cb(p)); + } +} |