Method
rewrite_args_internal
(
&self,
mapping: &std::collections::HashMap<usize, usize>,
)
Source from the content-addressed store, hash-verified
| 118 | } |
| 119 | |
| 120 | pub(crate) fn rewrite_args_internal( |
| 121 | &self, |
| 122 | mapping: &std::collections::HashMap<usize, usize>, |
| 123 | ) -> PyExpr { |
| 124 | let new_inner = self.inner.rewrite_arg_refs(mapping); |
| 125 | let new_temp_args = self |
| 126 | .temp_args |
| 127 | .iter() |
| 128 | .map(|(old_id, name)| { |
| 129 | let new_id = mapping.get(old_id).copied().unwrap_or(*old_id); |
| 130 | (new_id, name.clone()) |
| 131 | }) |
| 132 | .collect(); |
| 133 | PyExpr { |
| 134 | inner: new_inner, |
| 135 | name: self.name.clone(), |
| 136 | temp_args: new_temp_args, |
| 137 | } |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | /// Convert a Python object to a `CoercedExpr` (`Expr` + `temp_args`). |