forked from katzen-cafe/iowo
prowocessing: apply most basic reviews
This commit is contained in:
parent
734a734f09
commit
b7bc0366c2
6 changed files with 46 additions and 42 deletions
|
@ -4,7 +4,7 @@ use core::panic;
|
|||
use crate::experimental::trait_based::{
|
||||
data::{
|
||||
io::{Inputs, Outputs},
|
||||
raw::Data,
|
||||
raw::DataRef,
|
||||
},
|
||||
element::{DataType, ElementSignature, PipelineElement},
|
||||
};
|
||||
|
@ -14,7 +14,7 @@ pub struct Add(pub i32);
|
|||
impl PipelineElement for Add {
|
||||
fn runner(&self) -> fn(&Inputs) -> Outputs {
|
||||
|input| {
|
||||
if let [Data::Int(i0), Data::Int(i1), ..] = input.inner()[..] {
|
||||
if let [DataRef::Int(i0), DataRef::Int(i1), ..] = input.inner()[..] {
|
||||
(i0 + i1).into()
|
||||
} else {
|
||||
panic!("Invalid data passed")
|
||||
|
@ -35,7 +35,7 @@ pub struct Subtract(pub i32);
|
|||
impl PipelineElement for Subtract {
|
||||
fn runner(&self) -> fn(&Inputs) -> Outputs {
|
||||
|input| {
|
||||
if let [Data::Int(i0), Data::Int(i1), ..] = input.inner()[..] {
|
||||
if let [DataRef::Int(i0), DataRef::Int(i1), ..] = input.inner()[..] {
|
||||
(i0 + i1).into()
|
||||
} else {
|
||||
panic!("Invalid data passed")
|
||||
|
@ -56,7 +56,7 @@ pub struct Stringify;
|
|||
impl PipelineElement for Stringify {
|
||||
fn runner(&self) -> fn(&Inputs) -> Outputs {
|
||||
|input| {
|
||||
if let [Data::Int(int), ..] = input.inner()[..] {
|
||||
if let [DataRef::Int(int), ..] = input.inner()[..] {
|
||||
int.to_string().into()
|
||||
} else {
|
||||
panic!("Invalid data passed")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue