From 059fc26df1e13ebbb5593ffc2d86837676223d29 Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Fri, 7 Jun 2024 12:12:03 +0900 Subject: [PATCH] revset: forward RevsetExpression::parents()/children() to inner functions --- lib/src/revset.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/src/revset.rs b/lib/src/revset.rs index 263074e72..16c5872c1 100644 --- a/lib/src/revset.rs +++ b/lib/src/revset.rs @@ -301,10 +301,7 @@ impl RevsetExpression { /// Parents of `self`. pub fn parents(self: &Rc) -> Rc { - Rc::new(RevsetExpression::Ancestors { - heads: self.clone(), - generation: 1..2, - }) + self.ancestors_at(1) } /// Ancestors of `self`, including `self`. @@ -331,10 +328,7 @@ impl RevsetExpression { /// Children of `self`. pub fn children(self: &Rc) -> Rc { - Rc::new(RevsetExpression::Descendants { - roots: self.clone(), - generation: 1..2, - }) + self.descendants_at(1) } /// Descendants of `self`, including `self`.