Skip to content

Commit

Permalink
Panic in case rewriting dependency paths as relative yields a non-UTF…
Browse files Browse the repository at this point in the history
…8 sequence
  • Loading branch information
hdoordt committed Nov 5, 2024
1 parent 1aa5a8a commit c5b5bcd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,11 @@ fn rewrite_dep_path_as_relative<P: AsRef<std::path::Path>>(dep: &mut Dependency,
if let Dependency::Detailed(detail) = dep {
detail.path = detail.path.as_mut().map(|path| {
pathdiff::diff_paths(path, parent.as_ref())
.unwrap()
.to_string_lossy()
.expect(
"Error rewriting dependency path as relative: unable to determine path diff.",
)
.to_str()
.expect("Error rewriting dependency path as relative: path diff is not UTF-8.")
.to_string()
})
}
Expand Down

0 comments on commit c5b5bcd

Please sign in to comment.