Fix check_for_file_and_add's check for conflict file

Signed-off-by: Eval EXEC <execvy@gmail.com>
This commit is contained in:
Eval EXEC 2023-05-13 12:17:45 +08:00
parent f7d0c8bf94
commit 1dde1e16ee
No known key found for this signature in database
GPG Key ID: 0F0272C0D3AC91F7

View File

@ -332,10 +332,7 @@ fn check_for_file_and_add(
Err(_) => {
// The file exists somewhere outside of the package.
let file_name = file_path.file_name().unwrap();
if result
.iter()
.any(|ar| ar.rel_path.file_name().unwrap() == file_name)
{
if result.iter().any(|ar| ar.rel_path == file_name) {
ws.config().shell().warn(&format!(
"{} `{}` appears to be a path outside of the package, \
but there is already a file named `{}` in the root of the package. \