From e0f6e0966f029664a2590891e9a2f8f6954f7f30 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Thu, 10 Oct 2024 12:51:22 -0700 Subject: [PATCH] Add Recipe::subsequents (#2428) --- src/justfile.rs | 2 +- src/recipe.rs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/justfile.rs b/src/justfile.rs index 5123f8c73d..c846900a7c 100644 --- a/src/justfile.rs +++ b/src/justfile.rs @@ -346,7 +346,7 @@ impl<'src> Justfile<'src> { if !context.config.no_dependencies { let mut ran = Ran::default(); - for Dependency { recipe, arguments } in recipe.dependencies.iter().skip(recipe.priors) { + for Dependency { recipe, arguments } in recipe.subsequents() { let mut evaluated = Vec::new(); for argument in arguments { diff --git a/src/recipe.rs b/src/recipe.rs index 3976983aef..bb9fe14e33 100644 --- a/src/recipe.rs +++ b/src/recipe.rs @@ -469,6 +469,10 @@ impl<'src, D> Recipe<'src, D> { } self.doc } + + pub(crate) fn subsequents(&self) -> impl Iterator { + self.dependencies.iter().skip(self.priors) + } } impl<'src, D: Display> ColorDisplay for Recipe<'src, D> {