From 3921ed67b20a4541b1fa378de95c1dbe3d5cc5ef Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Thu, 16 Jan 2025 18:12:36 +0100 Subject: [PATCH] [`path_buf_push_overwrite`]: mark suggestion as `MaybeIncorrect` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Proposing to replace ```rust let mut x = PathBuf::from("/foo"); x.push("/bar"); ``` by ```rust let mut x = PathBuf::from("/foo"); x.push("bar"); ``` changes the content of `x` (`/bar` ⇒ `/foo/bar`). --- clippy_lints/src/methods/path_buf_push_overwrite.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clippy_lints/src/methods/path_buf_push_overwrite.rs b/clippy_lints/src/methods/path_buf_push_overwrite.rs index 2d3007e50b81c..38d9c5f16778e 100644 --- a/clippy_lints/src/methods/path_buf_push_overwrite.rs +++ b/clippy_lints/src/methods/path_buf_push_overwrite.rs @@ -28,7 +28,7 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>, arg: &'t "calling `push` with '/' or '\\' (file system root) will overwrite the previous path definition", "try", format!("\"{}\"", pushed_path_lit.trim_start_matches(['/', '\\'])), - Applicability::MachineApplicable, + Applicability::MaybeIncorrect, ); } }