From 52137052656d91fc1589e30489d648ca928a607b Mon Sep 17 00:00:00 2001 From: Suman Biswas <89653112+mrsumanbiswas@users.noreply.github.com> Date: Mon, 9 Jan 2023 23:44:08 +0530 Subject: [PATCH] error fix - fixed the `Option` condition - fixed the `swap` value --- exercises/clippy/clippy3.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/exercises/clippy/clippy3.rs b/exercises/clippy/clippy3.rs index b0159ebe..3abd5ad6 100644 --- a/exercises/clippy/clippy3.rs +++ b/exercises/clippy/clippy3.rs @@ -6,7 +6,7 @@ #[allow(unused_variables, unused_assignments)] fn main() { let my_option: Option<()> = None; - if my_option.is_none() { + if !my_option.is_none() { my_option.unwrap(); } @@ -22,7 +22,8 @@ fn main() { let mut value_a = 45; let mut value_b = 66; // Let's swap these two! + let temp_a = value_a; value_a = value_b; - value_b = value_a; + value_b = temp_a; println!("value a: {}; value b: {}", value_a, value_b); }