Directory under which the current file's module declares its SUBMODULES.
(fromFileAbs: string)
| 1876 | |
| 1877 | /** Directory under which the current file's module declares its SUBMODULES. */ |
| 1878 | function rustSelfModuleDir(fromFileAbs: string): string { |
| 1879 | const base = path.basename(fromFileAbs); |
| 1880 | const dir = path.dirname(fromFileAbs); |
| 1881 | // mod.rs / lib.rs / main.rs own their directory; `foo.rs`'s submodules live in `foo/`. |
| 1882 | if (base === 'mod.rs' || base === 'lib.rs' || base === 'main.rs') return dir; |
| 1883 | return path.join(dir, base.replace(/\.rs$/, '')); |
| 1884 | } |
| 1885 | |
| 1886 | /** |
| 1887 | * Resolve a Rust module path (segments WITHOUT the leaf symbol) to the file of |
no test coverage detected