Directory under which the current file's module declares its SUBMODULES.
(fromFileAbs: string)
| 1612 | |
| 1613 | /** Directory under which the current file's module declares its SUBMODULES. */ |
| 1614 | function rustSelfModuleDir(fromFileAbs: string): string { |
| 1615 | const base = path.basename(fromFileAbs); |
| 1616 | const dir = path.dirname(fromFileAbs); |
| 1617 | // mod.rs / lib.rs / main.rs own their directory; `foo.rs`'s submodules live in `foo/`. |
| 1618 | if (base === 'mod.rs' || base === 'lib.rs' || base === 'main.rs') return dir; |
| 1619 | return path.join(dir, base.replace(/\.rs$/, '')); |
| 1620 | } |
| 1621 | |
| 1622 | /** |
| 1623 | * Resolve a Rust module path (segments WITHOUT the leaf symbol) to the file of |
no test coverage detected