aboutsummaryrefslogtreecommitdiff
path: root/libgitmail/src/set.rs
blob: 2c71743dfdd0cd4a0727eed3c61eade4ff285272 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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));
  }
}