Skip to content

Commit

Permalink
refactor: always write generated files to out_dir as-is
Browse files Browse the repository at this point in the history
  • Loading branch information
stoically committed May 31, 2020
1 parent 63c55b6 commit a5a788f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions gen/build/src/paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,11 @@ fn relative_to_parent_of_target_dir(original: &Path) -> Result<PathBuf> {
}

pub(crate) fn out_with_extension(path: &Path, ext: &str) -> Result<PathBuf> {
let mut file_name = path.file_name().unwrap().to_owned();
file_name.push(ext);

let out_dir = out_dir()?;
let rel = relative_to_parent_of_target_dir(path)?;
Ok(out_dir.join(rel).with_file_name(file_name))
let mut out = out_dir.join(path).as_os_str().to_owned();
out.push(ext);

Ok(out.into())
}

pub(crate) fn include_dir() -> Result<PathBuf> {
Expand Down

0 comments on commit a5a788f

Please sign in to comment.