From 38016cb2d6053c7d4f18c7ca98880a3ac7d392fa Mon Sep 17 00:00:00 2001 From: mo8it Date: Wed, 13 Nov 2024 16:06:41 +0100 Subject: clippy3: Make the intent more clear --- solutions/22_clippy/clippy3.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'solutions') diff --git a/solutions/22_clippy/clippy3.rs b/solutions/22_clippy/clippy3.rs index 811d184..b7eaa57 100644 --- a/solutions/22_clippy/clippy3.rs +++ b/solutions/22_clippy/clippy3.rs @@ -3,11 +3,11 @@ use std::mem; #[rustfmt::skip] #[allow(unused_variables, unused_assignments)] fn main() { - let my_option: Option<()> = None; + let my_option: Option<&str> = None; // `unwrap` of an `Option` after checking if it is `None` will panic. // Use `if-let` instead. if let Some(value) = my_option { - println!("{value:?}"); + println!("{value}"); } // A comma was missing. -- cgit v1.2.3