MCPcopy Create free account
hub / github.com/YuminosukeSato/ironkernel / rewrite_args_internal

Method rewrite_args_internal

src/python/py_expr.rs:120–138  ·  view source on GitHub ↗
(
        &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`).

Callers 3

rewrite_argsMethod · 0.80

Calls 2

rewrite_arg_refsMethod · 0.80
mapMethod · 0.45