fix clippy with events

This commit is contained in:
Evan Almloff 2023-08-31 16:43:24 -05:00
parent bf90b7584e
commit 364654e1fd
2 changed files with 55 additions and 55 deletions

View file

@ -105,111 +105,111 @@ pub trait HtmlEventConverter: Send + Sync {
fn convert_wheel_data(&self, event: &PlatformEventData) -> WheelData; fn convert_wheel_data(&self, event: &PlatformEventData) -> WheelData;
} }
impl Into<AnimationData> for &PlatformEventData { impl From<&PlatformEventData> for AnimationData {
fn into(self) -> AnimationData { fn from(val: &PlatformEventData) -> Self {
with_event_converter(|c| c.convert_animation_data(self)) with_event_converter(|c| c.convert_animation_data(val))
} }
} }
impl Into<ClipboardData> for &PlatformEventData { impl From<&PlatformEventData> for ClipboardData {
fn into(self) -> ClipboardData { fn from(val: &PlatformEventData) -> Self {
with_event_converter(|c| c.convert_clipboard_data(self)) with_event_converter(|c| c.convert_clipboard_data(val))
} }
} }
impl Into<CompositionData> for &PlatformEventData { impl From<&PlatformEventData> for CompositionData {
fn into(self) -> CompositionData { fn from(val: &PlatformEventData) -> Self {
with_event_converter(|c| c.convert_composition_data(self)) with_event_converter(|c| c.convert_composition_data(val))
} }
} }
impl Into<DragData> for &PlatformEventData { impl From<&PlatformEventData> for DragData {
fn into(self) -> DragData { fn from(val: &PlatformEventData) -> Self {
with_event_converter(|c| c.convert_drag_data(self)) with_event_converter(|c| c.convert_drag_data(val))
} }
} }
impl Into<FocusData> for &PlatformEventData { impl From<&PlatformEventData> for FocusData {
fn into(self) -> FocusData { fn from(val: &PlatformEventData) -> Self {
with_event_converter(|c| c.convert_focus_data(self)) with_event_converter(|c| c.convert_focus_data(val))
} }
} }
impl Into<FormData> for &PlatformEventData { impl From<&PlatformEventData> for FormData {
fn into(self) -> FormData { fn from(val: &PlatformEventData) -> Self {
with_event_converter(|c| c.convert_form_data(self)) with_event_converter(|c| c.convert_form_data(val))
} }
} }
impl Into<ImageData> for &PlatformEventData { impl From<&PlatformEventData> for ImageData {
fn into(self) -> ImageData { fn from(val: &PlatformEventData) -> Self {
with_event_converter(|c| c.convert_image_data(self)) with_event_converter(|c| c.convert_image_data(val))
} }
} }
impl Into<KeyboardData> for &PlatformEventData { impl From<&PlatformEventData> for KeyboardData {
fn into(self) -> KeyboardData { fn from(val: &PlatformEventData) -> Self {
with_event_converter(|c| c.convert_keyboard_data(self)) with_event_converter(|c| c.convert_keyboard_data(val))
} }
} }
impl Into<MediaData> for &PlatformEventData { impl From<&PlatformEventData> for MediaData {
fn into(self) -> MediaData { fn from(val: &PlatformEventData) -> Self {
with_event_converter(|c| c.convert_media_data(self)) with_event_converter(|c| c.convert_media_data(val))
} }
} }
impl Into<MountedData> for &PlatformEventData { impl From<&PlatformEventData> for MountedData {
fn into(self) -> MountedData { fn from(val: &PlatformEventData) -> Self {
with_event_converter(|c| c.convert_mounted_data(self)) with_event_converter(|c| c.convert_mounted_data(val))
} }
} }
impl Into<MouseData> for &PlatformEventData { impl From<&PlatformEventData> for MouseData {
fn into(self) -> MouseData { fn from(val: &PlatformEventData) -> Self {
with_event_converter(|c| c.convert_mouse_data(self)) with_event_converter(|c| c.convert_mouse_data(val))
} }
} }
impl Into<PointerData> for &PlatformEventData { impl From<&PlatformEventData> for PointerData {
fn into(self) -> PointerData { fn from(val: &PlatformEventData) -> Self {
with_event_converter(|c| c.convert_pointer_data(self)) with_event_converter(|c| c.convert_pointer_data(val))
} }
} }
impl Into<ScrollData> for &PlatformEventData { impl From<&PlatformEventData> for ScrollData {
fn into(self) -> ScrollData { fn from(val: &PlatformEventData) -> Self {
with_event_converter(|c| c.convert_scroll_data(self)) with_event_converter(|c| c.convert_scroll_data(val))
} }
} }
impl Into<SelectionData> for &PlatformEventData { impl From<&PlatformEventData> for SelectionData {
fn into(self) -> SelectionData { fn from(val: &PlatformEventData) -> Self {
with_event_converter(|c| c.convert_selection_data(self)) with_event_converter(|c| c.convert_selection_data(val))
} }
} }
impl Into<ToggleData> for &PlatformEventData { impl From<&PlatformEventData> for ToggleData {
fn into(self) -> ToggleData { fn from(val: &PlatformEventData) -> Self {
with_event_converter(|c| c.convert_toggle_data(self)) with_event_converter(|c| c.convert_toggle_data(val))
} }
} }
impl Into<TouchData> for &PlatformEventData { impl From<&PlatformEventData> for TouchData {
fn into(self) -> TouchData { fn from(val: &PlatformEventData) -> Self {
with_event_converter(|c| c.convert_touch_data(self)) with_event_converter(|c| c.convert_touch_data(val))
} }
} }
impl Into<TransitionData> for &PlatformEventData { impl From<&PlatformEventData> for TransitionData {
fn into(self) -> TransitionData { fn from(val: &PlatformEventData) -> Self {
with_event_converter(|c| c.convert_transition_data(self)) with_event_converter(|c| c.convert_transition_data(val))
} }
} }
impl Into<WheelData> for &PlatformEventData { impl From<&PlatformEventData> for WheelData {
fn into(self) -> WheelData { fn from(val: &PlatformEventData) -> Self {
with_event_converter(|c| c.convert_wheel_data(self)) with_event_converter(|c| c.convert_wheel_data(val))
} }
} }

View file

@ -162,7 +162,7 @@ impl WebEventExt<web_sys::AnimationEvent> for dioxus_html::AnimationData {
impl WebEventExt<web_sys::Event> for dioxus_html::ClipboardData { impl WebEventExt<web_sys::Event> for dioxus_html::ClipboardData {
fn web_event(&self) -> &web_sys::Event { fn web_event(&self) -> &web_sys::Event {
&self self
.downcast::<web_sys::Event>() .downcast::<web_sys::Event>()
.expect("event should be a web_sys::Event") .expect("event should be a web_sys::Event")
} }