Directory under which the current file's module declares its SUBMODULES.
(fromFileAbs: string)
| 1860 | |
| 1861 | /** Directory under which the current file's module declares its SUBMODULES. */ |
| 1862 | function rustSelfModuleDir(fromFileAbs: string): string { |
| 1863 | const base = path.basename(fromFileAbs); |
| 1864 | const dir = path.dirname(fromFileAbs); |
| 1865 | // mod.rs / lib.rs / main.rs own their directory; `foo.rs`'s submodules live in `foo/`. |
| 1866 | if (base === 'mod.rs' || base === 'lib.rs' || base === 'main.rs') return dir; |
| 1867 | return path.join(dir, base.replace(/\.rs$/, '')); |
| 1868 | } |
| 1869 | |
| 1870 | /** |
| 1871 | * Resolve a Rust module path (segments WITHOUT the leaf symbol) to the file of |
no test coverage detected