mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-08-17 23:01:04 +02:00
refactor: fix some strict clippy warnings
This commit is contained in:
parent
bd9b3af5bc
commit
ca524f19f6
13 changed files with 28 additions and 33 deletions
|
@ -466,11 +466,10 @@ impl Module<gtk::Box> for LauncherModule {
|
|||
&container,
|
||||
self.page_size,
|
||||
self.layout.orientation(info),
|
||||
IconContext {
|
||||
icon_back: &self.icons.page_back,
|
||||
icon_fwd: &self.icons.page_forward,
|
||||
icon_size: self.pagination_icon_size,
|
||||
icon_theme: info.icon_theme,
|
||||
&IconContext {
|
||||
back: &self.icons.page_back,
|
||||
fwd: &self.icons.page_forward,
|
||||
size: self.pagination_icon_size,
|
||||
},
|
||||
);
|
||||
|
||||
|
@ -524,9 +523,9 @@ impl Module<gtk::Box> for LauncherModule {
|
|||
);
|
||||
|
||||
if self.reversed {
|
||||
container.pack_end(button.button.deref(), false, false, 0);
|
||||
container.pack_end(&*button.button, false, false, 0);
|
||||
} else {
|
||||
container.add(button.button.deref());
|
||||
container.add(&*button.button);
|
||||
}
|
||||
|
||||
if buttons.len() + 1 >= pagination.offset() + page_size {
|
||||
|
@ -599,7 +598,7 @@ impl Module<gtk::Box> for LauncherModule {
|
|||
}
|
||||
}
|
||||
LauncherUpdate::Hover(_) => {}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
rx.recv_glib(handle_event);
|
||||
|
|
|
@ -14,10 +14,9 @@ pub struct Pagination {
|
|||
}
|
||||
|
||||
pub struct IconContext<'a> {
|
||||
pub icon_back: &'a str,
|
||||
pub icon_fwd: &'a str,
|
||||
pub icon_size: i32,
|
||||
pub icon_theme: &'a IconTheme,
|
||||
pub back: &'a str,
|
||||
pub fwd: &'a str,
|
||||
pub size: i32,
|
||||
}
|
||||
|
||||
impl Pagination {
|
||||
|
@ -86,8 +85,8 @@ impl Pagination {
|
|||
if page_size < *offset {
|
||||
*offset -= page_size;
|
||||
} else {
|
||||
*offset = 1
|
||||
};
|
||||
*offset = 1;
|
||||
}
|
||||
|
||||
Self::update_page(&container, *offset, page_size);
|
||||
|
||||
|
|
|
@ -156,7 +156,7 @@ impl Module<Overlay> for NotificationsModule {
|
|||
match initial_state {
|
||||
Ok(ev) => tx.send_update(ev).await,
|
||||
Err(err) => error!("{err:?}"),
|
||||
};
|
||||
}
|
||||
|
||||
while let Ok(ev) = rx.recv().await {
|
||||
tx.send_update(ev).await;
|
||||
|
|
|
@ -251,7 +251,7 @@ impl Module<gtk::Box> for SysInfoModule {
|
|||
RefreshType::Disks => client.refresh_disks(),
|
||||
RefreshType::Network => client.refresh_network(),
|
||||
RefreshType::System => client.refresh_load_average(),
|
||||
};
|
||||
}
|
||||
|
||||
for (i, token_set) in format_tokens.iter().enumerate() {
|
||||
let is_affected = token_set
|
||||
|
|
|
@ -237,7 +237,7 @@ fn parse_formatting(chars: &mut Peekable<Chars>, mut formatting: Formatting) ->
|
|||
formatting.align = Alignment::try_from(char)?;
|
||||
}
|
||||
(_, FormattingMode::WidthFillAlign) => formatting.fill = char,
|
||||
};
|
||||
}
|
||||
|
||||
next_char = chars.next();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue