(lines: &[String])
| 166 | } |
| 167 | |
| 168 | fn build_script_from_lines(lines: &[String]) -> eyre::Result<rune::Sources> { |
| 169 | let mut sources = rune::Sources::new(); |
| 170 | let mut all_lines = vec!["pub fn eval_field(x, y) {".to_string()]; |
| 171 | all_lines.extend_from_slice(lines); |
| 172 | all_lines.push("return (x_new, y_new); }".to_string()); |
| 173 | |
| 174 | let script = all_lines.join("\n"); |
| 175 | let source = rune::Source::memory(script)?; |
| 176 | sources.insert(source)?; |
| 177 | Ok(sources) |
| 178 | } |
| 179 | |
| 180 | struct VectorField { |
| 181 | function: VectorFieldFunction, |
no outgoing calls
no test coverage detected