Skip to content

Commit

Permalink
Janitor: Fix clippy::useless_conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
hunger authored and ogoffart committed Aug 4, 2021
1 parent c74565a commit ce976a1
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions api/sixtyfps-rs/lib.rs
Expand Up @@ -369,7 +369,7 @@ pub mod internal {
/// Creates a new window to render components in.
#[doc(hidden)]
pub fn create_window() -> re_exports::WindowRc {
sixtyfps_rendering_backend_default::backend().create_window().into()
sixtyfps_rendering_backend_default::backend().create_window()
}

/// Enters the main event loop. This is necessary in order to receive
Expand Down Expand Up @@ -587,7 +587,7 @@ pub mod testing {
&dyn_rc,
x,
y,
&rc.window_handle().clone().into(),
&rc.window_handle().clone(),
);
}

Expand Down Expand Up @@ -616,7 +616,7 @@ pub mod testing {
sixtyfps_corelib::tests::send_keyboard_string_sequence(
&super::SharedString::from(sequence),
KEYBOARD_MODIFIERS.with(|x| x.get()),
&component.window_handle().clone().into(),
&component.window_handle().clone(),
)
}

Expand Down
8 changes: 4 additions & 4 deletions sixtyfps_runtime/corelib/window.rs
Expand Up @@ -197,7 +197,7 @@ impl Window {
self.mouse_input_state.set(crate::input::process_mouse_input(
component,
event,
&self.clone().into(),
&self.clone(),
self.mouse_input_state.take(),
));
}
Expand All @@ -210,7 +210,7 @@ impl Window {
pub fn process_key_input(self: Rc<Self>, event: &KeyEvent) {
let mut item = self.focus_item.borrow().clone();
while let Some(focus_item) = item.upgrade() {
if focus_item.borrow().as_ref().key_event(event, &self.clone().into())
if focus_item.borrow().as_ref().key_event(event, &self.clone())
== crate::input::KeyEventResult::EventAccepted
{
return;
Expand All @@ -236,7 +236,7 @@ impl Window {
/// Sets the focus to the item pointed to by item_ptr. This will remove the focus from any
/// currently focused item.
pub fn set_focus_item(self: Rc<Self>, focus_item: &ItemRc) {
let window = &self.clone().into();
let window = &self.clone();

if let Some(old_focus_item) = self.as_ref().focus_item.borrow().upgrade() {
old_focus_item
Expand All @@ -253,7 +253,7 @@ impl Window {
/// Sets the focus on the window to true or false, depending on the have_focus argument.
/// This results in WindowFocusReceived and WindowFocusLost events.
pub fn set_focus(self: Rc<Self>, have_focus: bool) {
let window = &self.clone().into();
let window = &self.clone();
let event = if have_focus {
crate::input::FocusEvent::WindowReceivedFocus
} else {
Expand Down
6 changes: 3 additions & 3 deletions sixtyfps_runtime/interpreter/dynamic_component.rs
Expand Up @@ -334,7 +334,7 @@ impl<'id> ComponentDescription<'id> {
sixtyfps_rendering_backend_default::backend();
sixtyfps_rendering_backend_gl::create_gl_window_with_canvas_id(canvas_id)
};
self.create_with_existing_window(&window.into())
self.create_with_existing_window(&window)
}

#[doc(hidden)]
Expand Down Expand Up @@ -536,7 +536,7 @@ extern "C" fn visit_children_item(
sixtyfps_corelib::item_tree::visit_item_tree(
instance_ref.instance,
&vtable::VRc::into_dyn(comp_rc),
instance_ref.component_type.item_tree.as_slice().into(),
instance_ref.component_type.item_tree.as_slice(),
index,
order,
v,
Expand Down Expand Up @@ -998,7 +998,7 @@ pub fn instantiate(
if !component_type.original.is_global() {
sixtyfps_corelib::component::init_component_items(
instance_ref.instance,
instance_ref.component_type.item_tree.as_slice().into(),
instance_ref.component_type.item_tree.as_slice(),
eval::window_ref(instance_ref).unwrap(),
);
}
Expand Down
2 changes: 1 addition & 1 deletion sixtyfps_runtime/interpreter/eval_layout.rs
Expand Up @@ -235,7 +235,7 @@ fn box_layout_data(
);
} else {
let mut layout_info =
get_layout_info(&cell.element, component, &window.clone().into(), orientation);
get_layout_info(&cell.element, component, &window.clone(), orientation);
fill_layout_info_constraints(
&mut layout_info,
&cell.constraints,
Expand Down
2 changes: 1 addition & 1 deletion sixtyfps_runtime/rendering_backends/gl/graphics_window.rs
Expand Up @@ -348,7 +348,7 @@ impl GraphicsWindow {
self.mouse_input_state.set(corelib::input::process_mouse_input(
component,
event,
&self.self_weak.upgrade().unwrap().into(),
&self.self_weak.upgrade().unwrap(),
self.mouse_input_state.take(),
));

Expand Down
2 changes: 1 addition & 1 deletion tools/lsp/main.rs
Expand Up @@ -363,7 +363,7 @@ fn show_preview_command(
let component = params.get(1).and_then(|v| v.as_str()).map(|v| v.to_string());
preview::load_preview(
connection.sender.clone(),
preview::PreviewComponent { path: path_canon.into(), component },
preview::PreviewComponent { path: path_canon, component },
preview::PostLoadBehavior::ShowAfterLoad,
);
Ok(())
Expand Down

0 comments on commit ce976a1

Please sign in to comment.