mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-21 21:09:42 +00:00
Fixed some Rust code structure and modified the workflow to fail if clippy returns warnings (#569)
* Fixed someone else's mistakes * workflow now fails if clippy returns warnings * refactor: Make base title variable constant --------- Co-authored-by: Liam <lj3954@users.noreply.github.com>
This commit is contained in:
parent
59744e89de
commit
f2332a7da2
2
.github/workflows/rust.yml
vendored
2
.github/workflows/rust.yml
vendored
|
@ -38,7 +38,7 @@ jobs:
|
||||||
restore-keys: ${{ runner.os }}-cargo-index-
|
restore-keys: ${{ runner.os }}-cargo-index-
|
||||||
|
|
||||||
- name: Run cargo clippy
|
- name: Run cargo clippy
|
||||||
run: cargo clippy
|
run: cargo clippy -- -Dwarnings
|
||||||
|
|
||||||
- name: Run cargo fmt
|
- name: Run cargo fmt
|
||||||
run: cargo fmt --all --check
|
run: cargo fmt --all --check
|
||||||
|
|
|
@ -21,6 +21,7 @@ use ratatui::{
|
||||||
|
|
||||||
const MIN_WIDTH: u16 = 77;
|
const MIN_WIDTH: u16 = 77;
|
||||||
const MIN_HEIGHT: u16 = 19;
|
const MIN_HEIGHT: u16 = 19;
|
||||||
|
const TITLE: &str = concat!("Linux Toolbox - ", env!("BUILD_DATE"));
|
||||||
|
|
||||||
pub struct AppState {
|
pub struct AppState {
|
||||||
/// Selected theme
|
/// Selected theme
|
||||||
|
@ -243,11 +244,11 @@ impl AppState {
|
||||||
Style::new()
|
Style::new()
|
||||||
};
|
};
|
||||||
|
|
||||||
let title = format!(
|
let title = if self.multi_select {
|
||||||
"Linux Toolbox - {} {}",
|
&format!("{} [Multi-Select]", TITLE)
|
||||||
env!("BUILD_DATE"),
|
} else {
|
||||||
self.multi_select.then(|| "[Multi-Select]").unwrap_or("")
|
TITLE
|
||||||
);
|
};
|
||||||
|
|
||||||
#[cfg(feature = "tips")]
|
#[cfg(feature = "tips")]
|
||||||
let bottom_title = Line::from(self.tip.bold().blue()).right_aligned();
|
let bottom_title = Line::from(self.tip.bold().blue()).right_aligned();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user