diff options
author | 2022-09-23 18:04:16 +0200 | |
---|---|---|
committer | 2022-09-23 18:04:16 +0200 | |
commit | 489a85518b4b533d92f59b468634cec5194ff567 (patch) | |
tree | 39d4c4b567f2f1c84ad035d38b020de5b682b47a /native/src/widget/text_input.rs | |
parent | 35cf105072ec73a35ff8292576c9e53777f9da13 (diff) | |
parent | 3e82ab069e6003b123dc133e8f4bcfd1a37ea93d (diff) | |
download | iced-489a85518b4b533d92f59b468634cec5194ff567.tar.gz iced-489a85518b4b533d92f59b468634cec5194ff567.tar.bz2 iced-489a85518b4b533d92f59b468634cec5194ff567.zip |
Merge pull request #1444 from iced-rs/fix/clippy-lints
Fix latest `clippy` lints
Diffstat (limited to 'native/src/widget/text_input.rs')
-rw-r--r-- | native/src/widget/text_input.rs | 24 |
1 files changed, 10 insertions, 14 deletions
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); |