We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Apply changes on docs
1 parent 5516113 commit 0cf2168Copy full SHA for 0cf2168
clippy_lints/src/methods/mod.rs
@@ -369,6 +369,17 @@ declare_clippy_lint! {
369
///
370
/// ### Why is this bad?
371
/// 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
380
381
+ /// x.expect_err("Testing expect_err");
382
383
#[clippy::version = "1.61.0"]
384
pub ERR_EXPECT,
385
style,
0 commit comments