Fix processing mod with multi-level path on Windows
This commit is contained in:
parent
577a5b2703
commit
bd6c81aebb
1 changed files with 8 additions and 1 deletions
|
@ -6149,7 +6149,14 @@ impl<'a> Parser<'a> {
|
|||
}
|
||||
|
||||
pub fn submod_path_from_attr(attrs: &[Attribute], dir_path: &Path) -> Option<PathBuf> {
|
||||
attr::first_attr_value_str_by_name(attrs, "path").map(|d| dir_path.join(&d.as_str()))
|
||||
if let Some(s) = attr::first_attr_value_str_by_name(attrs, "path") {
|
||||
let s = s.as_str();
|
||||
#[cfg(windows)]
|
||||
let s = s.replace("/", "\\");
|
||||
Some(dir_path.join(s))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns either a path to a module, or .
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue