Code review, remove identity test

This commit is contained in:
Adam
2025-07-14 17:38:32 -07:00
parent 7ecd1d0054
commit 54097ebcb5
14 changed files with 71 additions and 113 deletions

View File

@@ -1,6 +1,30 @@
use crate::Node;
use crate::{
Node,
registry::{Any, DynFuture, SharedNodeContainer},
};
use std::marker::PhantomData;
pub struct IdentityNode {
value: SharedNodeContainer,
}
impl<'i> Node<'i, Any<'i>> for IdentityNode {
type Output = DynFuture<'i, Any<'i>>;
fn eval(&'i self, input: Any<'i>) -> Self::Output {
Box::pin(async move { self.value.eval(input).await })
}
}
impl IdentityNode {
pub const fn new(value: SharedNodeContainer) -> Self {
IdentityNode { value }
}
}
pub mod identity {
pub const IDENTIFIER: crate::ProtoNodeIdentifier = crate::ProtoNodeIdentifier::new("graphene_core::ops::IdentityNode");
}
// Type
// TODO: Document this
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
@@ -135,13 +159,3 @@ impl<'input, I: 'input + Convert<_O> + Sync + Send, _O: 'input> Node<'input, I>
Box::pin(async move { input.convert() })
}
}
#[cfg(test)]
mod test {
use super::*;
#[test]
pub fn identity_node() {
assert_eq!(identity(&4), &4);
}
}