Skip to content

Commit

Permalink
rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
hacknus committed Dec 22, 2024
1 parent 9c03c5c commit 858a4fb
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 13 deletions.
30 changes: 21 additions & 9 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,25 @@ jobs:

runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- run: sudo apt-get update && sudo apt-get install -y libclang-dev libgtk-3-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev && sudo apt-get install libudev-dev && cargo install cargo-bundle
- name: Check
run: cargo check --verbose
- name: Format
run: cargo fmt --all -- --check --verbose
- uses: actions/checkout@v4

- name: Install libraries
run: sudo apt-get update && sudo apt-get install -y libclang-dev libgtk-3-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev && sudo apt-get install libudev-dev && cargo install cargo-bundle

- name: Update
run: cargo update

- name: Build
run: cargo build --all --all-features

- name: Cargo check
run: cargo check --all --all-features

- name: Rustfmt
run: cargo fmt --all -- --check

- name: Clippy
run: cargo clippy -- -D warnings --verbose
- name: Run tests
run: cargo test --verbose
run: cargo clippy --all --all-targets --all-features

- name: Test
run: cargo test --all --all-features
2 changes: 1 addition & 1 deletion src/custom_highlighter.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
extern crate regex;
use eframe::egui::{self, text::LayoutJob, Color32, TextFormat};
use eframe::egui::{FontFamily, FontId};

extern crate regex;
use regex::Regex;
use regex::RegexSet;
const DEFAULT_FONT_ID: FontId = FontId::new(14.0, FontFamily::Monospace);
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ use eframe::{egui, icon_data};
use preferences::AppInfo;

mod color_picker;
mod custom_highlighter;
mod data;
mod gui;
mod io;
mod serial;
mod toggle;
mod custom_highlighter;

const APP_INFO: AppInfo = AppInfo {
name: "Serial Monitor",
Expand Down
3 changes: 1 addition & 2 deletions src/serial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@ pub struct SerialDevices {
pub color_vals: Vec<Vec<f32>>,
pub number_of_plots: Vec<usize>,
pub number_of_highlights: Vec<usize>,

}

impl Default for SerialDevices {
fn default() -> Self {
SerialDevices {
devices: vec![Device::default()],
labels: vec![vec!["Column 0".to_string()]],
highlight_labels:vec![vec!["".to_string()]],
highlight_labels: vec![vec!["".to_string()]],
colors: vec![vec![COLORS[0]]],
color_vals: vec![vec![0.0]],
number_of_plots: vec![1],
Expand Down

0 comments on commit 858a4fb

Please sign in to comment.