(body: &[Statement])
| 323 | // ─── imports ─── |
| 324 | |
| 325 | fn extract_imports(body: &[Statement]) -> Vec<String> { |
| 326 | let mut imports = Vec::new(); |
| 327 | |
| 328 | for statement in body { |
| 329 | match statement { |
| 330 | Statement::Import(import) => { |
| 331 | for alias in &import.names { |
| 332 | imports.push(alias.name.to_string()); |
| 333 | } |
| 334 | } |
| 335 | |
| 336 | Statement::ImportFrom(import) => { |
| 337 | let module = import |
| 338 | .module |
| 339 | .as_ref() |
| 340 | .map(ToString::to_string) |
| 341 | .unwrap_or_default(); |
| 342 | |
| 343 | for alias in &import.names { |
| 344 | if module.is_empty() { |
| 345 | imports.push(alias.name.to_string()); |
| 346 | } else { |
| 347 | imports.push(format!("{}.{}", module, alias.name)); |
| 348 | } |
| 349 | } |
| 350 | } |
| 351 | _ => {} |
| 352 | } |
| 353 | } |
| 354 | |
| 355 | imports |
| 356 | } |
| 357 | |
| 358 | // ─── schemas ─── |
| 359 |
nothing calls this directly
no outgoing calls
no test coverage detected