From c7ffbd8759638ae58907dda255714586b83a8132 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Wed, 24 Jan 2024 13:35:41 +0100 Subject: [PATCH] nak: fix clippy::single_match warnings Part-of: --- src/nouveau/compiler/nak/assign_regs.rs | 7 ++----- src/nouveau/compiler/nak/encode_sm70.rs | 9 +++------ 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/nouveau/compiler/nak/assign_regs.rs b/src/nouveau/compiler/nak/assign_regs.rs index 242ae46d2a5..bc4e5c071f2 100644 --- a/src/nouveau/compiler/nak/assign_regs.rs +++ b/src/nouveau/compiler/nak/assign_regs.rs @@ -1202,11 +1202,8 @@ impl Shader { live = SimpleLiveness::for_function(f); max_live = live.calc_max_live(f); - match file { - RegFile::Bar => { - tmp_gprs = max(tmp_gprs, 2); - } - _ => (), + if file == RegFile::Bar { + tmp_gprs = max(tmp_gprs, 2); } } } diff --git a/src/nouveau/compiler/nak/encode_sm70.rs b/src/nouveau/compiler/nak/encode_sm70.rs index 44b7d657dfa..36e6981a570 100644 --- a/src/nouveau/compiler/nak/encode_sm70.rs +++ b/src/nouveau/compiler/nak/encode_sm70.rs @@ -2088,13 +2088,10 @@ impl Shader { for b in &func.blocks { labels.insert(b.label, ip); for instr in &b.instrs { - match &instr.op { - Op::Nop(op) => { - if let Some(label) = op.label { - labels.insert(label, ip); - } + if let Op::Nop(op) = &instr.op { + if let Some(label) = op.label { + labels.insert(label, ip); } - _ => (), } ip += 4; }