(proc: Processor<T>, input: T, use_fallback: bool)
| 46 | } |
| 47 | |
| 48 | fn run_processor<T: Copy>(proc: Processor<T>, input: T, use_fallback: bool) -> T { |
| 49 | if use_fallback { |
| 50 | (proc.fallback)(input) |
| 51 | } else { |
| 52 | match proc.step { |
| 53 | ComputeStep::Unary(f) => f(input), |
| 54 | ComputeStep::Binary(f, arg) => f(input, arg), |
| 55 | ComputeStep::Constant(val) => val, |
| 56 | } |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | fn apply_pair_pipeline<T>(pair: Pair<fn(T) -> T, fn(T) -> T>, val: T) -> T { |
| 61 | let intermediate = (pair.first)(val); |
nothing calls this directly
no outgoing calls
no test coverage detected