From 60e8da1647e9001efa760ce52997c95ff518b5ad Mon Sep 17 00:00:00 2001 From: Boyu Yang Date: Thu, 13 Sep 2018 11:51:58 +0800 Subject: [PATCH 1/2] Fix typo in examples. --- clippy_lints/src/methods.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clippy_lints/src/methods.rs b/clippy_lints/src/methods.rs index f428a498b4da..f462c2eb63d9 100644 --- a/clippy_lints/src/methods.rs +++ b/clippy_lints/src/methods.rs @@ -342,11 +342,11 @@ declare_clippy_lint! { /// /// **Example:** /// ```rust -/// foo.expect(&format("Err {}: {}", err_code, err_msg)) +/// foo.expect(&format!("Err {}: {}", err_code, err_msg)) /// ``` /// or /// ```rust -/// foo.expect(format("Err {}: {}", err_code, err_msg).as_str()) +/// foo.expect(format!("Err {}: {}", err_code, err_msg).as_str()) /// ``` /// this can instead be written: /// ```rust @@ -354,7 +354,7 @@ declare_clippy_lint! { /// ``` /// or /// ```rust -/// foo.unwrap_or_else(|_| panic!(format("Err {}: {}", err_code, err_msg).as_str())) +/// foo.unwrap_or_else(|_| panic!(format!("Err {}: {}", err_code, err_msg).as_str())) /// ``` declare_clippy_lint! { pub EXPECT_FUN_CALL, From 4827ab978e50bbb553d1b35db5787657e97710c6 Mon Sep 17 00:00:00 2001 From: Boyu Yang Date: Thu, 13 Sep 2018 13:01:23 +0800 Subject: [PATCH 2/2] Remove a wrong suggestion. --- clippy_lints/src/methods.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/clippy_lints/src/methods.rs b/clippy_lints/src/methods.rs index f462c2eb63d9..3d458343a50b 100644 --- a/clippy_lints/src/methods.rs +++ b/clippy_lints/src/methods.rs @@ -352,10 +352,6 @@ declare_clippy_lint! { /// ```rust /// foo.unwrap_or_else(|_| panic!("Err {}: {}", err_code, err_msg)) /// ``` -/// or -/// ```rust -/// foo.unwrap_or_else(|_| panic!(format!("Err {}: {}", err_code, err_msg).as_str())) -/// ``` declare_clippy_lint! { pub EXPECT_FUN_CALL, perf,