From 1dde1e16ee46d7dce0eda22c3db931ac548e76e4 Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Sat, 13 May 2023 12:17:45 +0800 Subject: [PATCH] Fix `check_for_file_and_add`'s check for conflict file Signed-off-by: Eval EXEC --- src/cargo/ops/cargo_package.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/cargo/ops/cargo_package.rs b/src/cargo/ops/cargo_package.rs index b78d02928..f80848c75 100644 --- a/src/cargo/ops/cargo_package.rs +++ b/src/cargo/ops/cargo_package.rs @@ -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. \