From bac5a9a6b61be4400d9959a897c2d19ae7fa0abf Mon Sep 17 00:00:00 2001 From: sawyer bristol Date: Thu, 3 Oct 2024 13:54:35 -0600 Subject: [PATCH] cargo clippy --- src/engines/ultralight.rs | 6 +++--- src/widgets/bookmark_bar.rs | 2 +- src/widgets/command_window.rs | 8 ++++---- src/widgets/mod.rs | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/engines/ultralight.rs b/src/engines/ultralight.rs index c8f47c6..00adfc6 100644 --- a/src/engines/ultralight.rs +++ b/src/engines/ultralight.rs @@ -1,4 +1,4 @@ -use clipboard_rs::{Clipboard, ClipboardContext, ContentFormat}; +use clipboard_rs::{Clipboard, ClipboardContext}; use iced::keyboard::{self}; use iced::mouse::{self, ScrollDelta}; use iced::{Point, Size}; @@ -381,7 +381,7 @@ fn iced_key_to_ultralight_key( modifiers: keyboard::Modifiers, text: Option, ) -> Option { - let (mut text, virtual_key, native_key) = { + let (text, virtual_key, native_key) = { if let Some(key) = key { let text = match key { keyboard::Key::Named(key) => { @@ -881,7 +881,7 @@ fn iced_key_to_ultralight_key( shift: modifiers.shift(), }; - let ty = if modifiers.ctrl == true { + let ty = if modifiers.ctrl { event::KeyEventType::RawKeyDown } else if !text.is_empty() && text.is_ascii() && press == KeyPress::Press { event::KeyEventType::Char diff --git a/src/widgets/bookmark_bar.rs b/src/widgets/bookmark_bar.rs index 3567da1..dc707c4 100644 --- a/src/widgets/bookmark_bar.rs +++ b/src/widgets/bookmark_bar.rs @@ -4,7 +4,7 @@ use super::Message; use crate::Bookmark; /// Creates bookmark bar widget -pub fn bookmark_bar(bookmarks: &Vec) -> Element { +pub fn bookmark_bar(bookmarks: &[Bookmark]) -> Element { Row::from_vec( bookmarks .iter() diff --git a/src/widgets/command_window.rs b/src/widgets/command_window.rs index 63fb244..40af61f 100644 --- a/src/widgets/command_window.rs +++ b/src/widgets/command_window.rs @@ -5,10 +5,10 @@ use strum::IntoEnumIterator; use super::Message; -pub enum ResultType { - Command(Message), - // Bookmark, -} +// pub enum ResultType { +// Command(Message), +// // Bookmark, +// } pub struct CommandWindowState { pub query: String, diff --git a/src/widgets/mod.rs b/src/widgets/mod.rs index ae4fec2..a09b6b2 100644 --- a/src/widgets/mod.rs +++ b/src/widgets/mod.rs @@ -135,7 +135,7 @@ where use crate::engines::ultralight::Ultralight; #[cfg(feature = "ultralight")] -impl<'a, CustomViewState: Clone> BrowserWidget { +impl BrowserWidget { pub fn new_basic() -> BrowserWidget { BrowserWidget { engine: Some(Ultralight::new()),