mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-17 23:38:06 +08:00
committed by
Keavon Chambers
parent
1d6c4f13dd
commit
76c754d38a
@@ -8,7 +8,7 @@ pub struct IntNode<const N: u32>;
|
||||
|
||||
impl<'i, const N: u32> Node<'i, ()> for IntNode<N> {
|
||||
type Output = u32;
|
||||
fn eval<'s: 'i>(&'s self, _input: ()) -> Self::Output {
|
||||
fn eval(&'i self, _input: ()) -> Self::Output {
|
||||
N
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ pub struct ValueNode<T>(pub T);
|
||||
|
||||
impl<'i, T: 'i> Node<'i, ()> for ValueNode<T> {
|
||||
type Output = &'i T;
|
||||
fn eval<'s: 'i>(&'s self, _input: ()) -> Self::Output {
|
||||
fn eval(&'i self, _input: ()) -> Self::Output {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,7 @@ pub struct ClonedNode<T: Clone>(pub T);
|
||||
|
||||
impl<'i, T: Clone + 'i> Node<'i, ()> for ClonedNode<T> {
|
||||
type Output = T;
|
||||
fn eval<'s: 'i>(&'s self, _input: ()) -> Self::Output {
|
||||
fn eval(&'i self, _input: ()) -> Self::Output {
|
||||
self.0.clone()
|
||||
}
|
||||
}
|
||||
@@ -69,7 +69,7 @@ pub struct DefaultNode<T>(PhantomData<T>);
|
||||
|
||||
impl<'i, T: Default + 'i> Node<'i, ()> for DefaultNode<T> {
|
||||
type Output = T;
|
||||
fn eval<'s: 'i>(&self, _input: ()) -> Self::Output {
|
||||
fn eval(&'i self, _input: ()) -> Self::Output {
|
||||
T::default()
|
||||
}
|
||||
}
|
||||
@@ -87,7 +87,7 @@ pub struct ForgetNode;
|
||||
|
||||
impl<'i, T: 'i> Node<'i, T> for ForgetNode {
|
||||
type Output = ();
|
||||
fn eval<'s: 'i>(&self, _input: T) -> Self::Output {}
|
||||
fn eval(&'i self, _input: T) -> Self::Output {}
|
||||
}
|
||||
|
||||
impl ForgetNode {
|
||||
|
||||
Reference in New Issue
Block a user