Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
LegitCamper committed Sep 23, 2024
1 parent 783bc8c commit a89bef3
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fn main() {
panic!("Could not find either debug or release dirs")
}

assert!(possible_directories.len() >= 1);
assert!(!possible_directories.is_empty());

let local_resources = Path::new(PATH).join("resources");

Expand Down
12 changes: 9 additions & 3 deletions src/shortcut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl ShortcutBuilder {
}
unreachable!()
})
.filter(|item| *item == true)
.filter(|item| *item) // if item == true
.count()
!= 1
{
Expand All @@ -42,7 +42,7 @@ impl ShortcutBuilder {
}
unreachable!()
})
.filter(|item| *item == true)
.filter(|item| *item) // if itme == true
.count()
< 1
{
Expand All @@ -58,6 +58,12 @@ impl ShortcutBuilder {
}
}

impl Default for ShortcutBuilder {
fn default() -> Self {
Self::new()
}
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub enum ShortcutModifier {
Shift,
Expand Down Expand Up @@ -98,5 +104,5 @@ pub fn check_shortcut(shortcut: &Shortcut, key: &Key, modifiers: &Modifiers) ->
ShortcutModifier::Alt => modifiers.alt(),
},
})
.all(|s| s == true)
.all(|s| s) // if s == true
}
8 changes: 7 additions & 1 deletion src/widgets/command_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ impl CommandWindowState {
}
}

impl Default for CommandWindowState {
fn default() -> Self {
Self::new()
}
}

pub fn command_window<'a>(
base: impl Into<Element<'a, Message>>,
state: &'a CommandWindowState,
Expand All @@ -33,7 +39,7 @@ pub fn command_window<'a>(
.width(Length::Fill)
.height(Length::Fill)
.style(|theme: &Theme, _| iced_aw::style::selection_list::Style {
text_color: theme.palette().text.into(),
text_color: theme.palette().text,
background: theme.palette().background.into(),
..Default::default()
}),
Expand Down
7 changes: 7 additions & 0 deletions src/widgets/nav_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@ use super::Message;

/// Holds the state of infomation in nav_bar
pub struct NavBarState(pub String);

impl NavBarState {
pub fn new() -> Self {
NavBarState(String::new())
}
}

impl Default for NavBarState {
fn default() -> Self {
Self::new()
}
}

pub fn nav_bar(state: &NavBarState) -> Element<Message> {
let back = tooltip_helper(
Button::new(icon_to_text(Bootstrap::ChevronBarLeft))
Expand Down

0 comments on commit a89bef3

Please sign in to comment.