(prefix: &P, extender_variables: (Var, Var))
| 138 | } |
| 139 | |
| 140 | fn direction<P>(prefix: &P, extender_variables: (Var, Var)) -> Result<Direction, &'static str> |
| 141 | where |
| 142 | P: AsBinding + std::fmt::Debug, |
| 143 | { |
| 144 | match AsBinding::binds(prefix, extender_variables.0) { |
| 145 | None => match AsBinding::binds(prefix, extender_variables.1) { |
| 146 | None => { |
| 147 | error!( |
| 148 | "Neither extender variable {:?} bound by prefix {:?}.", |
| 149 | extender_variables, prefix |
| 150 | ); |
| 151 | Err("Neither extender variable bound by prefix.") |
| 152 | } |
| 153 | Some(offset) => Ok(Direction::Reverse(offset)), |
| 154 | }, |
| 155 | Some(offset) => { |
| 156 | match AsBinding::binds(prefix, extender_variables.1) { |
| 157 | Some(_) => Err("Both extender variables already bound by prefix."), |
| 158 | None => { |
| 159 | // Prefix binds the first extender variable, but not |
| 160 | // the second. Can use forward index. |
| 161 | Ok(Direction::Forward(offset)) |
| 162 | } |
| 163 | } |
| 164 | } |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | /// Bindings can be in conflict with the source binding of a given |
| 169 | /// delta pipeline. We need to identify them and handle them as |
no outgoing calls
no test coverage detected