Skip to content

Commit acbc925

Browse files
Format run
Signed-off-by: Cole Gentry <peapod2007@gmail.com>
1 parent f1ba091 commit acbc925

8 files changed

Lines changed: 54 additions & 40 deletions

File tree

src/app.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,12 @@ impl UltraLogApp {
295295
// The mapping is dropped after parsing completes.
296296
let mmap = match unsafe { Mmap::map(&file) } {
297297
Ok(m) => m,
298-
Err(e) => return Err(LoadResult::Error(format!("Failed to memory-map file: {}", e))),
298+
Err(e) => {
299+
return Err(LoadResult::Error(format!(
300+
"Failed to memory-map file: {}",
301+
e
302+
)))
303+
}
299304
};
300305

301306
Self::parse_binary_data(&mmap, path)
@@ -816,8 +821,7 @@ impl UltraLogApp {
816821

817822
/// Get the pending jump-to-time request for the active tab
818823
pub fn get_jump_to_time(&self) -> Option<f64> {
819-
self.active_tab
820-
.and_then(|idx| self.tabs[idx].jump_to_time)
824+
self.active_tab.and_then(|idx| self.tabs[idx].jump_to_time)
821825
}
822826

823827
/// Set a jump-to-time request for the active tab (chart will center on this time)

src/parsers/haltech.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ use std::sync::LazyLock;
77
use strum::{AsRefStr, EnumString};
88

99
/// Pre-compiled regex for detecting data rows (timestamp pattern)
10-
static TIMESTAMP_REGEX: LazyLock<Regex> = LazyLock::new(|| {
11-
Regex::new(r"^\d{1,2}:\d{2}:\d{2}").expect("Invalid timestamp regex")
12-
});
10+
static TIMESTAMP_REGEX: LazyLock<Regex> =
11+
LazyLock::new(|| Regex::new(r"^\d{1,2}:\d{2}:\d{2}").expect("Invalid timestamp regex"));
1312

1413
use super::types::{Channel, Log, Meta, Parseable, Value};
1514

src/ui/channels.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,7 @@ impl UltraLogApp {
174174
// Get display name
175175
let channel_name = selected.channel.name();
176176
let display_name = if use_normalization {
177-
normalize_channel_name_with_custom(
178-
&channel_name,
179-
Some(&self.custom_normalizations),
180-
)
177+
normalize_channel_name_with_custom(&channel_name, Some(&self.custom_normalizations))
181178
} else {
182179
channel_name
183180
};
@@ -292,8 +289,9 @@ impl UltraLogApp {
292289
jump_to = Some((record, time));
293290
}
294291
if btn.hovered() {
295-
ui.ctx()
296-
.set_cursor_icon(egui::CursorIcon::PointingHand);
292+
ui.ctx().set_cursor_icon(
293+
egui::CursorIcon::PointingHand,
294+
);
297295
}
298296
}
299297
});
@@ -321,8 +319,9 @@ impl UltraLogApp {
321319
jump_to = Some((record, time));
322320
}
323321
if btn.hovered() {
324-
ui.ctx()
325-
.set_cursor_icon(egui::CursorIcon::PointingHand);
322+
ui.ctx().set_cursor_icon(
323+
egui::CursorIcon::PointingHand,
324+
);
326325
}
327326
}
328327
});

src/ui/chart.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@ impl UltraLogApp {
254254
}
255255
}
256256
}
257-
258257
}
259258

260259
/// Format time in seconds to a human-readable string (h:mm:ss.xxx or m:ss.xxx or s.xxx)

src/ui/menu.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,10 @@ impl UltraLogApp {
118118

119119
// Auto-update preference
120120
if ui
121-
.checkbox(&mut self.auto_check_updates, "🔄 Check for Updates on Startup")
121+
.checkbox(
122+
&mut self.auto_check_updates,
123+
"🔄 Check for Updates on Startup",
124+
)
122125
.on_hover_text("Automatically check for new versions when the app starts")
123126
.clicked()
124127
{
@@ -435,7 +438,10 @@ impl UltraLogApp {
435438
"🔄 Check for Updates"
436439
};
437440

438-
if ui.add_enabled(!is_checking, egui::Button::new(button_text)).clicked() {
441+
if ui
442+
.add_enabled(!is_checking, egui::Button::new(button_text))
443+
.clicked()
444+
{
439445
self.start_update_check();
440446
ui.close_menu();
441447
}

src/ui/toast.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ impl UltraLogApp {
2020
.order(egui::Order::Foreground)
2121
.show(ctx, |ui| {
2222
egui::Frame::none()
23-
.fill(egui::Color32::from_rgb(bg_color[0], bg_color[1], bg_color[2]))
23+
.fill(egui::Color32::from_rgb(
24+
bg_color[0],
25+
bg_color[1],
26+
bg_color[2],
27+
))
2428
.rounding(8.0)
2529
.inner_margin(egui::Margin::symmetric(16.0, 12.0))
2630
.shadow(egui::epaint::Shadow {

src/ui/update_dialog.rs

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,23 @@ impl UltraLogApp {
2424
.default_width(420.0)
2525
.anchor(egui::Align2::CENTER_CENTER, [0.0, 0.0])
2626
.order(egui::Order::Foreground)
27-
.show(ctx, |ui| {
28-
match &self.update_state {
29-
UpdateState::UpdateAvailable(info) => {
30-
let info_clone = info.clone();
31-
self.render_update_available(ui, info_clone, &mut should_close);
32-
}
33-
UpdateState::Downloading => {
34-
self.render_downloading(ui);
35-
}
36-
UpdateState::ReadyToInstall(path) => {
37-
let path_clone = path.clone();
38-
self.render_ready_to_install(ui, &path_clone, &mut should_close);
39-
}
40-
UpdateState::Error(e) => {
41-
let error = e.clone();
42-
self.render_update_error(ui, &error, &mut should_close);
43-
}
44-
_ => {}
27+
.show(ctx, |ui| match &self.update_state {
28+
UpdateState::UpdateAvailable(info) => {
29+
let info_clone = info.clone();
30+
self.render_update_available(ui, info_clone, &mut should_close);
31+
}
32+
UpdateState::Downloading => {
33+
self.render_downloading(ui);
4534
}
35+
UpdateState::ReadyToInstall(path) => {
36+
let path_clone = path.clone();
37+
self.render_ready_to_install(ui, &path_clone, &mut should_close);
38+
}
39+
UpdateState::Error(e) => {
40+
let error = e.clone();
41+
self.render_update_error(ui, &error, &mut should_close);
42+
}
43+
_ => {}
4644
});
4745

4846
if !open || should_close {
@@ -63,7 +61,11 @@ impl UltraLogApp {
6361
ui.vertical_centered(|ui| {
6462
ui.add_space(10.0);
6563

66-
ui.label(egui::RichText::new("A new version is available!").size(18.0).strong());
64+
ui.label(
65+
egui::RichText::new("A new version is available!")
66+
.size(18.0)
67+
.strong(),
68+
);
6769

6870
ui.add_space(15.0);
6971

@@ -189,7 +191,9 @@ impl UltraLogApp {
189191
if let Err(e) = crate::updater::install_update(path) {
190192
self.show_toast_error(&e);
191193
} else {
192-
self.show_toast_success("Update file opened. Follow the installer instructions.");
194+
self.show_toast_success(
195+
"Update file opened. Follow the installer instructions.",
196+
);
193197
*should_close = true;
194198
self.update_state = UpdateState::Idle;
195199
}

src/updater.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ use serde::Deserialize;
77
use std::io::Write;
88
use std::path::PathBuf;
99

10-
const GITHUB_API_URL: &str =
11-
"https://api.github.com/repos/SomethingNew71/UltraLog/releases/latest";
10+
const GITHUB_API_URL: &str = "https://api.github.com/repos/SomethingNew71/UltraLog/releases/latest";
1211
const USER_AGENT: &str = concat!("UltraLog/", env!("CARGO_PKG_VERSION"));
1312

1413
// ============================================================================

0 commit comments

Comments
 (0)