mirror of
https://forge.katzen.cafe/katzen-cafe/iowo.git
synced 2026-01-16 16:43:05 +01:00
simplified by entirely removing DataRef
This commit is contained in:
parent
c900a0f4b3
commit
a3e357a0e7
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