Skip to content

Commit

Permalink
Allow mod bar; in foo.rs refer to foo/bar/mod.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorc authored and ogoffart committed Jul 31, 2024
1 parent 30554cb commit c158de6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions xtr/src/crate_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ where
.parse_mod(adjacent)
.unwrap_or_else(|err| self.mod_error = Some(err));
}
let adjacent_mod = nested_mod_dir.join(without_suffix).join(&mod_name).join("mod.rs");
if adjacent_mod.is_file() {
return self
.parse_mod(adjacent_mod)
.unwrap_or_else(|err| self.mod_error = Some(err));
}
}

panic!(
Expand Down

0 comments on commit c158de6

Please sign in to comment.