Fix Clippy warnings blocking release checks
Some checks failed
Validate authentication / Validate authentication (push) Failing after 1s

This commit is contained in:
Alois 2026-10-04 21:14:35 +02:00
commit 976ffde7a8
Signed by: alois
SSH key fingerprint: SHA256:GBzT2DXvAuGV9XIV5W3WrzVpjU54FThmxHXdbz95J24
42 changed files with 315 additions and 346 deletions

View file

@ -488,12 +488,11 @@ impl InteractableElement for ConsoleCard {
if !key
.modifiers
.intersects(KeyModifiers::CONTROL | KeyModifiers::ALT)
&& let Some(c) = key.code.as_char()
{
if let Some(c) = key.code.as_char() {
self.insert_at_cursor(c);
self.message = None;
return IotaInteraction::Changed;
}
self.insert_at_cursor(c);
self.message = None;
return IotaInteraction::Changed;
}
IotaInteraction::Unhandled
}

View file

@ -435,7 +435,7 @@ impl JoinableElement for LogCard {
}
fn as_element(&self) -> &(dyn Element + 'static) {
&*self
self
}
fn as_element_mut(&mut self) -> &mut (dyn Element + 'static) {
@ -461,7 +461,7 @@ impl InteractableElement for LogCard {
}
fn as_element(&self) -> &(dyn Element + 'static) {
&*self
self
}
fn as_element_mut(&mut self) -> &mut (dyn Element + 'static) {

View file

@ -137,6 +137,12 @@ impl HelpOverlay {
}
}
impl Default for HelpOverlay {
fn default() -> Self {
Self::new()
}
}
impl IotaScreen for HelpOverlay {
fn render_legacy(&self, f: &mut Frame, rect: Rect, theme: &ResolvedTheme, _hits: &mut HitMap) {
let area = ratatool::layout::centered_rect(

View file

@ -1,3 +1,8 @@
#![allow(
clippy::module_inception,
reason = "preserve existing public module paths"
)]
pub mod elements {
pub mod console_card;
pub mod elements;

View file

@ -334,7 +334,7 @@ fn table_to_lines(table: Vec<Vec<String>>, theme: &ResolvedTheme) -> Vec<Display
.max()
.unwrap_or(h_len)
} else {
let max = (3 * h_len) as usize;
let max = 3 * h_len;
max.max(h_len)
}
})

View file

@ -198,7 +198,7 @@ impl IotaScreen for TermsCheckerScreen {
}
while size.height - 5 < text_lines.len() as u16 {
if optional_lines.len() == 0 {
if optional_lines.is_empty() {
break;
}
text_lines.remove(optional_lines[0] as usize);
@ -232,7 +232,7 @@ impl IotaScreen for TermsCheckerScreen {
Line::from(vec![
Span::raw("Height: "),
Span::styled(format!("{}", size.height), height_style),
Span::raw(format!(" / 13")),
Span::raw(" / 13".to_string()),
]),
]);
@ -241,7 +241,7 @@ impl IotaScreen for TermsCheckerScreen {
.block(
Block::default()
.borders(Borders::ALL)
.title(format!("UI Too Small [Q to Quit]")),
.title("UI Too Small [Q to Quit]".to_string()),
);
f.render_widget(warning, size);
return;
@ -249,7 +249,7 @@ impl IotaScreen for TermsCheckerScreen {
let consent_block = Paragraph::new(Text::from(text_lines)).block(
Block::default()
.title(format!(" Tensamin User Consent [Q to Quit] ",))
.title(" Tensamin User Consent [Q to Quit] ".to_string())
.borders(Borders::ALL),
);
f.render_widget(consent_block, chunks[0]);

View file

@ -513,7 +513,7 @@ impl IotaScreen for TermsUpdaterScreen {
};
while size.height - 5 < text_lines.len() as u16 {
if optional_lines.len() == 0 {
if optional_lines.is_empty() {
break;
}
text_lines.remove(optional_lines[0] as usize);
@ -632,7 +632,7 @@ impl IotaScreen for TermsUpdaterScreen {
if let Some(sender) = self.sender.take() {
let _ = sender.send(UserChoice::Deny);
}
return IotaInteraction::Pop;
IotaInteraction::Pop
}
KeyCode::Enter | KeyCode::Char(' ') => match self.focus {
Focus::Eula => {
@ -678,9 +678,7 @@ impl IotaScreen for TermsUpdaterScreen {
};
if let Some(terms_type) = terms_type {
return IotaInteraction::Effect(IotaEffect::LoadNewestTerms {
kind: terms_type,
});
IotaInteraction::Effect(IotaEffect::LoadNewestTerms { kind: terms_type })
} else {
IotaInteraction::Unhandled
}

View file

@ -698,7 +698,7 @@ impl IotaScreen for UsersScreen {
}
Err(error) => self.message = Some(error),
}
return IotaInteraction::Changed;
IotaInteraction::Changed
}
UiEvent::Message(IotaMessage::Event(AppEvent::UserOperationFinished(result))) => {
self.pending = false;
@ -706,7 +706,7 @@ impl IotaScreen for UsersScreen {
Ok(message) => message,
Err(error) => error,
});
return self.refresh();
self.refresh()
}
UiEvent::Message(IotaMessage::Event(AppEvent::CredentialExportFinished(result))) => {
self.pending = false;
@ -714,7 +714,7 @@ impl IotaScreen for UsersScreen {
Ok(message) => message,
Err(error) => error,
});
return IotaInteraction::Changed;
IotaInteraction::Changed
}
UiEvent::Message(IotaMessage::Event(AppEvent::TuInspected(result))) => {
if let Some(UsersOverlay::Add(flow)) = self.overlay.as_mut() {
@ -727,7 +727,7 @@ impl IotaScreen for UsersScreen {
}
}
}
return IotaInteraction::Changed;
IotaInteraction::Changed
}
UiEvent::Paste(text) => {
if let Some(UsersOverlay::Add(flow)) = self.overlay.as_mut() {
@ -753,7 +753,7 @@ impl IotaScreen for UsersScreen {
self.restore_selection();
return IotaInteraction::Changed;
}
return IotaInteraction::Unhandled;
IotaInteraction::Unhandled
}
UiEvent::Key(key) => {
if let Some(overlay) = &mut self.overlay {

View file

@ -129,7 +129,7 @@ impl UiConfig {
}
pub fn load() -> Result<Self, io::Error> {
let path = match (|| std::panic::catch_unwind(|| Self::path()))() {
let path = match std::panic::catch_unwind(Self::path) {
Ok(path) => path,
Err(_) => Self::fallback_path().ok_or_else(|| {
io::Error::new(io::ErrorKind::NotFound, "could not determine config path")

View file

@ -129,13 +129,11 @@ pub fn resolve_with_capabilities(
};
theme.name = name;
theme.unicode = unicode_enabled;
if !unicode_enabled {
if matches!(theme.console.cursor, CursorPresentation::Character { .. }) {
theme.console.cursor = CursorPresentation::Character {
glyph: "|",
style: theme.console.text,
};
}
if !unicode_enabled && matches!(theme.console.cursor, CursorPresentation::Character { .. }) {
theme.console.cursor = CursorPresentation::Character {
glyph: "|",
style: theme.console.text,
};
}
theme
}

View file

@ -27,6 +27,7 @@ fn choice(
suffix,
}
}
#[expect(clippy::too_many_arguments, reason = "explicit theme styles")]
fn base(
name: ThemeName,
normal: Style,

View file

@ -8,6 +8,10 @@ use crate::{
util::terms_focus::Focus,
};
#[expect(
clippy::too_many_arguments,
reason = "explicit button layout and styling"
)]
pub fn draw_buttons(
frame: &mut ratatui::Frame,
area: Rect,