just 1.22.1

🤖 Just a command runner
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use super::*;

#[derive(Default)]
pub(crate) struct Ran<'src>(BTreeMap<Namepath<'src>, BTreeSet<Vec<String>>>);

impl<'src> Ran<'src> {
  pub(crate) fn has_run(&self, recipe: &Namepath<'src>, arguments: &[String]) -> bool {
    self
      .0
      .get(recipe)
      .map(|ran| ran.contains(arguments))
      .unwrap_or_default()
  }

  pub(crate) fn ran(&mut self, recipe: &Namepath<'src>, arguments: Vec<String>) {
    self.0.entry(recipe.clone()).or_default().insert(arguments);
  }
}