Fix unnecessary use of match with if let (single_match)

This commit is contained in:
ice_iix 2020-07-02 17:22:24 -07:00
parent deb35db895
commit 113abefd80
2 changed files with 4 additions and 5 deletions

View File

@ -844,8 +844,8 @@ impl Server {
}
match channel {
// TODO: "REGISTER" =>
// TODO: "UNREGISTER" =>
"REGISTER" => {} // TODO
"UNREGISTER" => {} // TODO
"FML|HS" => {
let msg = crate::protocol::Serializable::read_from(&mut std::io::Cursor::new(data))
.unwrap();

View File

@ -1539,9 +1539,8 @@ impl UIElement for TextBox {
(VirtualKeyCode::V, true) => {
if ctrl_pressed {
let mut clipboard: ClipboardContext = ClipboardProvider::new().unwrap();
match clipboard.get_contents() {
Ok(text) => self.input.push_str(&text),
Err(_) => (),
if let Ok(text) = clipboard.get_contents() {
self.input.push_str(&text)
}
}
}