Skip to content

Commit

Permalink
Handle non-utf8 manifest dir
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jun 2, 2021
1 parent 4c69208 commit f9adde6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ pub fn dir(input: TokenStream) -> TokenStream {
let vis = &input.vis;
let rel_path = input.path.value();

let dir = match env::var("CARGO_MANIFEST_DIR") {
Ok(manifest_dir) => Path::new(&manifest_dir).join(rel_path),
Err(_) => PathBuf::from(rel_path),
let dir = match env::var_os("CARGO_MANIFEST_DIR") {
Some(manifest_dir) => PathBuf::from(manifest_dir).join(rel_path),
None => PathBuf::from(rel_path),
};

let expanded = match source_file_names(dir) {
Expand Down

0 comments on commit f9adde6

Please sign in to comment.