Skip to content

Commit 0cf2168

Browse files
committed
Revert certain changes on Apply changes on docs
1 parent 5516113 commit 0cf2168

File tree

1 file changed

+11
-0
lines changed
  • clippy_lints/src/methods

1 file changed

+11
-0
lines changed

clippy_lints/src/methods/mod.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,17 @@ declare_clippy_lint! {
369369
///
370370
/// ### Why is this bad?
371371
/// Because .expect_err() can be called directly.
372+
///
373+
/// ### Example
374+
/// ```should_panic
375+
/// let x: Result<u32, &str> = Ok(10);
376+
/// x.err().expect("Testing err().expect()");
377+
/// ```
378+
/// Use instead:
379+
/// ```should_panic
380+
/// let x: Result<u32, &str> = Ok(10);
381+
/// x.expect_err("Testing expect_err");
382+
/// ```
372383
#[clippy::version = "1.61.0"]
373384
pub ERR_EXPECT,
374385
style,

0 commit comments

Comments
 (0)