woboq / tr

Translation tools for rust
57 stars 9 forks source link

Allow `mod bar;` in `foo.rs` refer to `foo/bar/mod.rs` #23

Closed rodrigorc closed 2 months ago

rodrigorc commented 2 months ago

Hello!

I have a project with a few submodules with a slightly inconsistent but correct layout, such as:

parent
├── mod.rs  (use foo;)
├── foo.rs  (use bar;)
└── foo
    └── bar
        └── mod.rs

Running xtr fails with:

No file with module definition formod barin file "parent/foo.rs"

This PR covers this case.

ogoffart commented 2 months ago

Looks good, thank you.