From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- .../clippy/tests/ui/match_single_binding2.stderr | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 src/tools/clippy/tests/ui/match_single_binding2.stderr (limited to 'src/tools/clippy/tests/ui/match_single_binding2.stderr') diff --git a/src/tools/clippy/tests/ui/match_single_binding2.stderr b/src/tools/clippy/tests/ui/match_single_binding2.stderr new file mode 100644 index 000000000..22bf7d8be --- /dev/null +++ b/src/tools/clippy/tests/ui/match_single_binding2.stderr @@ -0,0 +1,68 @@ +error: this match could be written as a `let` statement + --> $DIR/match_single_binding2.rs:18:36 + | +LL | Some((iter, _item)) => match iter.size_hint() { + | ____________________________________^ +LL | | (min, max) => (min.saturating_add(1), max.and_then(|max| max.checked_add(1))), +LL | | }, + | |_____________^ + | + = note: `-D clippy::match-single-binding` implied by `-D warnings` +help: consider using a `let` statement + | +LL ~ Some((iter, _item)) => { +LL + let (min, max) = iter.size_hint(); +LL + (min.saturating_add(1), max.and_then(|max| max.checked_add(1))) +LL ~ }, + | + +error: this match could be written as a `let` statement + --> $DIR/match_single_binding2.rs:31:13 + | +LL | / match get_tup() { +LL | | (a, b) => println!("a {:?} and b {:?}", a, b), +LL | | } + | |_____________^ + | +help: consider using a `let` statement + | +LL ~ let (a, b) = get_tup(); +LL + println!("a {:?} and b {:?}", a, b); + | + +error: this match could be replaced by its scrutinee and body + --> $DIR/match_single_binding2.rs:42:5 + | +LL | / match side_effects() { +LL | | _ => println!("Side effects"), +LL | | } + | |_____^ + | +help: consider using the scrutinee and body instead + | +LL ~ side_effects(); +LL + println!("Side effects"); + | + +error: this match could be replaced by its scrutinee and body + --> $DIR/match_single_binding2.rs:49:5 + | +LL | / match match x { +LL | | 0 => 1, +LL | | _ => 2, +LL | | } { +LL | | _ => println!("Single branch"), +LL | | } + | |_____^ + | +help: consider using the scrutinee and body instead + | +LL ~ match x { +LL + 0 => 1, +LL + _ => 2, +LL + }; +LL + println!("Single branch"); + | + +error: aborting due to 4 previous errors + -- cgit v1.2.3