Simplify node trait definition (#1146)

* Simplify node trait
This commit is contained in:
Dennis Kobert
2023-04-17 23:42:22 +02:00
committed by Keavon Chambers
parent 1d6c4f13dd
commit 76c754d38a
11 changed files with 47 additions and 105 deletions

View File

@@ -14,7 +14,7 @@ where
Second: for<'a> Node<'a, <First as Node<'a, Input>>::Output> + 'i,
{
type Output = <Second as Node<'i, <First as Node<'i, Input>>::Output>>::Output;
fn eval<'s: 'i>(&'s self, input: Input) -> Self::Output {
fn eval(&'i self, input: Input) -> Self::Output {
let arg = self.first.eval(input);
self.second.eval(arg)
}
@@ -64,7 +64,7 @@ where
Root: Node<'i, I>,
{
type Output = (Input, Root::Output);
fn eval<'s: 'i>(&'s self, input: Input) -> Self::Output {
fn eval(&'i self, input: Input) -> Self::Output {
let arg = self.0.eval(I::from(()));
(input, arg)
}