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 4, 2024
1 parent 1aa5a8a commit 375369b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 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 determing path diff.",
)
.to_str()
.expect("Error rewriting dependency path as relative: path diff is not UTF-8.")
.to_string()
})
}
Expand Down Expand Up @@ -662,5 +665,3 @@ fn dep2toml_item(dependency: &Dependency) -> toml_edit::Item {

toml_edit::Item::Value(toml_edit::Value::InlineTable(table))
}

Check failure on line 667 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Format

this file contains an unclosed delimiter

Check failure on line 667 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Test

this file contains an unclosed delimiter

Check failure on line 667 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Code coverage

this file contains an unclosed delimiter

Check failure on line 667 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Lint

this file contains an unclosed delimiter
}
}

0 comments on commit 375369b

Please sign in to comment.