From 3e82ab069e6003b123dc133e8f4bcfd1a37ea93d Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 23 Sep 2022 17:51:42 +0200 Subject: Fix latest `clippy` lints --- native/src/widget/text_input.rs | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'native/src/widget/text_input.rs') diff --git a/native/src/widget/text_input.rs b/native/src/widget/text_input.rs index 8ddbc734..c2d25520 100644 --- a/native/src/widget/text_input.rs +++ b/native/src/widget/text_input.rs @@ -615,25 +615,21 @@ where keyboard::KeyCode::C if state.keyboard_modifiers.command() => { - match state.cursor.selection(value) { - Some((start, end)) => { - clipboard.write( - value.select(start, end).to_string(), - ); - } - None => {} + if let Some((start, end)) = + state.cursor.selection(value) + { + clipboard + .write(value.select(start, end).to_string()); } } keyboard::KeyCode::X if state.keyboard_modifiers.command() => { - match state.cursor.selection(value) { - Some((start, end)) => { - clipboard.write( - value.select(start, end).to_string(), - ); - } - None => {} + if let Some((start, end)) = + state.cursor.selection(value) + { + clipboard + .write(value.select(start, end).to_string()); } let mut editor = Editor::new(value, &mut state.cursor); -- cgit