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 { match channel {
// TODO: "REGISTER" => "REGISTER" => {} // TODO
// TODO: "UNREGISTER" => "UNREGISTER" => {} // TODO
"FML|HS" => { "FML|HS" => {
let msg = crate::protocol::Serializable::read_from(&mut std::io::Cursor::new(data)) let msg = crate::protocol::Serializable::read_from(&mut std::io::Cursor::new(data))
.unwrap(); .unwrap();

View File

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