diff --git a/src/lib.rs b/src/lib.rs index aa9faef..301692b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -82,8 +82,11 @@ fn rewrite_dep_path_as_relative>(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() }) } @@ -662,5 +665,3 @@ fn dep2toml_item(dependency: &Dependency) -> toml_edit::Item { toml_edit::Item::Value(toml_edit::Value::InlineTable(table)) } - } -}