()
| 64 | out[module] = sorted(set(fns)) |
| 65 | return out |
| 66 | |
| 67 | |
| 68 | def public_rust_modules() -> set[str]: |
| 69 | """Module paths rustdoc documents: every `pub mod` reachable from the crate root.""" |
| 70 | src = CRATES / "openquant" / "src" |
| 71 | out: set[str] = set() |
| 72 | |
| 73 | def walk(prefix: str, file: Path, directory: Path) -> None: |
| 74 | for line in file.read_text(encoding="utf-8").splitlines(): |
| 75 | m = re.match(r"^pub\s+mod\s+([A-Za-z0-9_]+)\s*;", line) |
| 76 | if not m: |
| 77 | continue |
| 78 | name = m.group(1) |
| 79 | path = f"{prefix}::{name}" |
| 80 | out.add(path) |
| 81 | sub_dir = directory / name |
| 82 | if (sub_dir / "mod.rs").exists(): |
| 83 | walk(path, sub_dir / "mod.rs", sub_dir) |
| 84 | elif (directory / f"{name}.rs").exists() and sub_dir.is_dir(): |
| 85 | walk(path, directory / f"{name}.rs", sub_dir) |
| 86 | |
| 87 | walk("openquant", src / "lib.rs", src) |
| 88 | return out |
no test coverage detected