Skip to content

Commit

Permalink
Removed commented out code
Browse files Browse the repository at this point in the history
  • Loading branch information
vigoo committed Apr 12, 2024
1 parent 47c49f7 commit a2ebee4
Showing 1 changed file with 1 addition and 45 deletions.
46 changes: 1 addition & 45 deletions golem-rust/src/transaction/compfn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,53 +65,9 @@ where
}
}
}
//
// impl<F, In, Out, Err> CompensationFunction<(In,), (Out,), (Err,)> for F
// where
// F: FnOnce(Option<Result<Out, Err>>, In) -> Result<(), Err>,
// {
// fn call(
// self,
// input: impl TupleOrUnit<(In,)>,
// result: Option<Result<impl TupleOrUnit<(Out,)>, (Err,)>>,
// ) -> Result<(), (Err,)> {
// let input = input.into();
// match result {
// Some(Ok(out)) => {
// let (out,) = out.into();
// self(Some(Ok(out)), input.0).map_err(|err| (err,))
// }
// Some(Err((err,))) => self(Some(Err(err)), input.0).map_err(|err| (err,)),
// None => self(None, input.0).map_err(|err| (err,)),
// }
// }
// }
//
// impl<F, In1, In2, Out, Err> CompensationFunction<(In1, In2), (Out,), (Err,)> for F
// where
// F: FnOnce(Option<Result<Out, Err>>, In1, In2) -> Result<(), Err>,
// {
// fn call(
// self,
// input: impl TupleOrUnit<(In1, In2)>,
// result: Option<Result<impl TupleOrUnit<(Out,)>, (Err,)>>,
// ) -> Result<(), (Err,)> {
// let input = input.into();
// match result {
// Some(Ok(out)) => {
// let (out,) = out.into();
// self(Some(Ok(out)), input.0, input.1).map_err(|err| (err,))
// }
// Some(Err((err,))) => self(Some(Err(err)), input.0, input.1).map_err(|err| (err,)),
// None => self(None, input.0, input.1).map_err(|err| (err,)),
// }
// }
// }

impl<T> TupleOrUnit<()> for T {
fn into(self) -> () {
()
}
fn into(self) {}
}

macro_rules! tuple_or_unit {
Expand Down

0 comments on commit a2ebee4

Please sign in to comment.