Skip to content

Commit

Permalink
Janitor: Fix clippy::single_match
Browse files Browse the repository at this point in the history
  • Loading branch information
hunger authored and tronical committed Aug 9, 2021
1 parent d50dcf7 commit 9dcd107
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
23 changes: 10 additions & 13 deletions sixtyfps_runtime/interpreter/dynamic_component.rs
Expand Up @@ -69,20 +69,17 @@ impl<'id> ComponentBox<'id> {
impl<'id> Drop for ComponentBox<'id> {
fn drop(&mut self) {
let instance_ref = self.borrow_instance();
match eval::window_ref(instance_ref) {
Some(window) => {
let items = self
.component_type
.items
.values()
.map(|item_within_component| unsafe {
item_within_component.item_from_component(instance_ref.as_ptr())
})
.collect::<Vec<_>>();
if let Some(window) = eval::window_ref(instance_ref) {
let items = self
.component_type
.items
.values()
.map(|item_within_component| unsafe {
item_within_component.item_from_component(instance_ref.as_ptr())
})
.collect::<Vec<_>>();

window.free_graphics_resources(&Slice::from_slice(items.as_slice()));
}
None => {}
window.free_graphics_resources(&Slice::from_slice(items.as_slice()));
}
}
}
Expand Down
7 changes: 2 additions & 5 deletions tools/lsp/main.rs
Expand Up @@ -254,11 +254,8 @@ fn handle_request(
.and_then(|token| get_code_actions(document_cache, token.0.parent()));
connection.sender.send(Message::Response(Response::new_ok(id, result)))?;
} else if let Some((id, params)) = cast::<ExecuteCommand>(&mut req) {
match params.command.as_str() {
SHOW_PREVIEW_COMMAND => {
show_preview_command(&params.arguments, connection, document_cache)?
}
_ => (),
if params.command.as_str() == SHOW_PREVIEW_COMMAND {
show_preview_command(&params.arguments, connection, document_cache)?
}
connection
.sender
Expand Down

0 comments on commit 9dcd107

Please sign in to comment.