forked from katzen-cafe/iowo
simplified by entirely removing DataRef
This commit is contained in:
parent
619b7acf94
commit
911339fc2a
6 changed files with 19 additions and 69 deletions
|
@ -4,7 +4,7 @@ use core::panic;
|
|||
use crate::experimental::trait_based::{
|
||||
data::{
|
||||
io::{Inputs, Outputs},
|
||||
raw::DataRef,
|
||||
raw::Data,
|
||||
},
|
||||
element::{DataType, ElementSignature, PipelineElement},
|
||||
};
|
||||
|
@ -14,7 +14,7 @@ pub struct Add(pub i32);
|
|||
impl PipelineElement for Add {
|
||||
fn runner(&self) -> fn(&Inputs) -> Outputs {
|
||||
|input| {
|
||||
let [DataRef::Int(i0), DataRef::Int(i1), ..] = input.inner()[..] else {
|
||||
let [Data::Int(i0), Data::Int(i1), ..] = input.0[..] else {
|
||||
panic!("Invalid data passed")
|
||||
};
|
||||
(i0 + i1).into()
|
||||
|
@ -34,7 +34,7 @@ pub struct Subtract(pub i32);
|
|||
impl PipelineElement for Subtract {
|
||||
fn runner(&self) -> fn(&Inputs) -> Outputs {
|
||||
|input| {
|
||||
let [DataRef::Int(i0), DataRef::Int(i1), ..] = input.inner()[..] else {
|
||||
let [Data::Int(i0), Data::Int(i1), ..] = input.0[..] else {
|
||||
panic!("Invalid data passed")
|
||||
};
|
||||
(i0 + i1).into()
|
||||
|
@ -54,7 +54,7 @@ pub struct Stringify;
|
|||
impl PipelineElement for Stringify {
|
||||
fn runner(&self) -> fn(&Inputs) -> Outputs {
|
||||
|input| {
|
||||
let [DataRef::Int(int), ..] = input.inner()[..] else {
|
||||
let [Data::Int(int), ..] = input.0[..] else {
|
||||
panic!("Invalid data passed")
|
||||
};
|
||||
int.to_string().into()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue