Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed some Rust code structure and modified the workflow to fail if clippy returns warnings #569

Merged
merged 3 commits into from
Sep 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
restore-keys: ${{ runner.os }}-cargo-index-

- name: Run cargo clippy
run: cargo clippy
run: cargo clippy -- -Dwarnings

- name: Run cargo fmt
run: cargo fmt --all --check
11 changes: 6 additions & 5 deletions tui/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use ratatui::{

const MIN_WIDTH: u16 = 77;
const MIN_HEIGHT: u16 = 19;
const TITLE: &str = concat!("Linux Toolbox - ", env!("BUILD_DATE"));

pub struct AppState {
/// Selected theme
Expand Down Expand Up @@ -243,11 +244,11 @@ impl AppState {
Style::new()
};

let title = format!(
"Linux Toolbox - {} {}",
env!("BUILD_DATE"),
self.multi_select.then(|| "[Multi-Select]").unwrap_or("")
);
let title = if self.multi_select {
&format!("{} [Multi-Select]", TITLE)
} else {
TITLE
};

#[cfg(feature = "tips")]
let bottom_title = Line::from(self.tip.bold().blue()).right_aligned();
Expand Down