woboq / tr

Translation tools for rust
58 stars 10 forks source link

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

Closed rodrigorc closed 3 months ago

rodrigorc commented 3 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 3 months ago

Looks good, thank you.