Fixing builds and workflows

This commit is contained in:
2026-01-31 17:52:44 +01:00
parent 8e09fd106e
commit 20bc0ffcb4
5 changed files with 24 additions and 13 deletions

View File

@@ -45,7 +45,6 @@ jobs:
uses: dtolnay/rust-toolchain@stable uses: dtolnay/rust-toolchain@stable
with: with:
targets: ${{ matrix.target }} targets: ${{ matrix.target }}
components: clippy
- name: Cache Rust dependencies - name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2 uses: Swatinem/rust-cache@v2
@@ -82,12 +81,6 @@ jobs:
- name: Bundle desktop app - name: Bundle desktop app
run: cargo bundle --release --features desktop --bin cagire-desktop --target ${{ matrix.target }} run: cargo bundle --release --features desktop --bin cagire-desktop --target ${{ matrix.target }}
- name: Run tests
run: cargo test --target ${{ matrix.target }}
- name: Run clippy
run: cargo clippy --target ${{ matrix.target }} -- -D warnings
- name: Upload artifact (Unix) - name: Upload artifact (Unix)
if: runner.os != 'Windows' if: runner.os != 'Windows'
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4

View File

@@ -48,6 +48,12 @@ pub struct App {
pub panel: PanelState, pub panel: PanelState,
} }
impl Default for App {
fn default() -> Self {
Self::new()
}
}
impl App { impl App {
pub fn new() -> Self { pub fn new() -> Self {
let variables = Arc::new(Mutex::new(HashMap::new())); let variables = Arc::new(Mutex::new(HashMap::new()));

View File

@@ -16,6 +16,12 @@ pub struct ScopeBuffer {
peak_right: AtomicU32, peak_right: AtomicU32,
} }
impl Default for ScopeBuffer {
fn default() -> Self {
Self::new()
}
}
impl ScopeBuffer { impl ScopeBuffer {
pub fn new() -> Self { pub fn new() -> Self {
Self { Self {
@@ -64,6 +70,12 @@ pub struct SpectrumBuffer {
pub bands: [AtomicU32; 32], pub bands: [AtomicU32; 32],
} }
impl Default for SpectrumBuffer {
fn default() -> Self {
Self::new()
}
}
impl SpectrumBuffer { impl SpectrumBuffer {
pub fn new() -> Self { pub fn new() -> Self {
Self { Self {

View File

@@ -2,9 +2,9 @@ mod audio;
mod link; mod link;
pub mod sequencer; pub mod sequencer;
pub use audio::{build_stream, AnalysisHandle, AudioStreamConfig, ScopeBuffer, SpectrumBuffer}; pub use audio::{build_stream, AudioStreamConfig, ScopeBuffer, SpectrumBuffer};
pub use link::LinkState; pub use link::LinkState;
pub use sequencer::{ pub use sequencer::{
spawn_sequencer, AudioCommand, PatternChange, PatternSnapshot, SeqCommand, SequencerConfig, spawn_sequencer, AudioCommand, PatternChange, PatternSnapshot, SeqCommand, SequencerConfig,
SequencerHandle, SequencerSnapshot, StepSnapshot, SequencerSnapshot, StepSnapshot,
}; };

View File

@@ -265,7 +265,7 @@ fn wrapped_line_count(line: &RLine, width: usize) -> usize {
if char_count == 0 || width == 0 { if char_count == 0 || width == 0 {
1 1
} else { } else {
(char_count + width - 1) / width char_count.div_ceil(width)
} }
} }
@@ -392,9 +392,9 @@ fn preprocess_markdown(md: &str) -> String {
fn convert_dash_lists(line: &str) -> String { fn convert_dash_lists(line: &str) -> String {
let trimmed = line.trim_start(); let trimmed = line.trim_start();
if trimmed.starts_with("- ") { if let Some(rest) = trimmed.strip_prefix("- ") {
let indent = line.len() - trimmed.len(); let indent = line.len() - trimmed.len();
format!("{}* {}", " ".repeat(indent), &trimmed[2..]) format!("{}* {}", " ".repeat(indent), rest)
} else { } else {
line.to_string() line.to_string()
} }
@@ -487,7 +487,7 @@ fn render_table_row(row: TableRow, row_idx: usize, col_widths: &[usize]) -> RLin
let is_header = row_idx == 0; let is_header = row_idx == 0;
let bg = if is_header { let bg = if is_header {
theme.ui.surface theme.ui.surface
} else if row_idx % 2 == 0 { } else if row_idx.is_multiple_of(2) {
theme.table.row_even theme.table.row_even
} else { } else {
theme.table.row_odd theme.table.row_odd