From e41aa38a8a15c22e6e47185519b83b0aedd54cec Mon Sep 17 00:00:00 2001 From: merelymyself Date: Wed, 25 May 2022 15:47:58 +0800 Subject: [PATCH] docs --- clippy_lints/src/path_from_format.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clippy_lints/src/path_from_format.rs b/clippy_lints/src/path_from_format.rs index 5920f7d93d74..ed5b6ea6ff58 100644 --- a/clippy_lints/src/path_from_format.rs +++ b/clippy_lints/src/path_from_format.rs @@ -17,10 +17,14 @@ declare_clippy_lint! { /// /// ### Example /// ```rust + /// use std::path::PathBuf; + /// let base_path = "/base"; /// PathBuf::from(format!("{}/foo/bar", base_path)); /// ``` /// Use instead: /// ```rust + /// use std::path::Path; + /// let base_path = "/base"; /// Path::new(base_path).join("foo").join("bar"); /// ``` #[clippy::version = "1.62.0"]