mirror of
https://github.com/forkless/NotAlterra.git
synced 2026-08-21 02:25:31 +02:00
Complete 100% function doc coverage
This commit is contained in:
@@ -179,6 +179,7 @@ fn scan_other_users(
|
||||
}
|
||||
}
|
||||
|
||||
/// Linux variant — same logic as the Windows version above.
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
fn scan_other_users(
|
||||
found: &mut Vec<DiscoveredFolder>,
|
||||
@@ -253,6 +254,7 @@ fn scan_common_install_dirs(
|
||||
}
|
||||
}
|
||||
|
||||
/// Linux variant — same logic as the Windows version above.
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
fn scan_common_install_dirs(
|
||||
found: &mut Vec<DiscoveredFolder>,
|
||||
|
||||
@@ -64,6 +64,7 @@ pub fn log_path() -> PathBuf {
|
||||
exe_dir().join("transaction.log")
|
||||
}
|
||||
|
||||
/// Return the directory containing the running executable.
|
||||
fn exe_dir() -> PathBuf {
|
||||
std::env::current_exe()
|
||||
.ok()
|
||||
|
||||
@@ -233,6 +233,7 @@ fn extract_double_property(data: &[u8], prop_name: &str) -> Option<f64> {
|
||||
None
|
||||
}
|
||||
|
||||
/// Extract an integer property value from a key-value text pair.
|
||||
fn extract_int_property(data: &[u8], prop_name: &str) -> Option<u32> {
|
||||
let target = prop_name.as_bytes();
|
||||
let mut offset = 0usize;
|
||||
@@ -479,6 +480,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
/// Test helper — dump full GVAS metadata for a sample file.
|
||||
fn print_full_meta() {
|
||||
let p = Path::new("samples/savegame_1.sav");
|
||||
if !p.exists() { return; }
|
||||
|
||||
@@ -100,19 +100,23 @@ impl App {
|
||||
})
|
||||
}
|
||||
|
||||
/// Returns the backup root directory alongside the binary.
|
||||
fn backup_root(&self) -> PathBuf {
|
||||
exe_dir().join("NotAlterra_Backups")
|
||||
}
|
||||
|
||||
/// Set the status bar message with optional style.
|
||||
fn set_status(&mut self, msg: &str, style: tui::StatusStyle) {
|
||||
self.tui_state.status_message = Some(msg.to_string());
|
||||
self.tui_state.status_style = style;
|
||||
}
|
||||
|
||||
/// Reset the status bar to empty.
|
||||
fn clear_status(&mut self) {
|
||||
self.tui_state.status_message = None;
|
||||
}
|
||||
|
||||
/// Show or hide the spinner indicator on the status bar.
|
||||
fn set_spinner(&mut self, active: bool) {
|
||||
self.tui_state.spinner_active = active;
|
||||
if active {
|
||||
|
||||
@@ -478,6 +478,7 @@ fn copy_save_files(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Recursively copy a directory tree.
|
||||
fn copy_recursive(
|
||||
src: &Path,
|
||||
dest: &Path,
|
||||
@@ -526,6 +527,7 @@ fn verify_backup(src: &Path, dest: &Path) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
/// List subdirectories whose names begin with a given prefix.
|
||||
fn list_subdirs(root: &Path, prefix: &str) -> Vec<PathBuf> {
|
||||
if !root.exists() {
|
||||
return Vec::new();
|
||||
|
||||
@@ -374,6 +374,7 @@ fn standard_layout(area: Rect, _menu_items: usize) -> Vec<Rect> {
|
||||
.split(area).to_vec()
|
||||
}
|
||||
|
||||
/// Render the title bar with version information.
|
||||
fn draw_header(f: &mut Frame, area: Rect, app: &AppState) {
|
||||
let header_block = Block::default()
|
||||
.borders(Borders::BOTTOM)
|
||||
@@ -411,6 +412,7 @@ fn draw_header(f: &mut Frame, area: Rect, app: &AppState) {
|
||||
f.render_widget(header_block, area);
|
||||
}
|
||||
|
||||
/// Render the status dashboard beneath the header.
|
||||
fn draw_status_dashboard(f: &mut Frame, area: Rect, app: &AppState) {
|
||||
let live = Span::styled(
|
||||
format!(" Save{}: {} ", if app.live_save_count == 1 { "" } else { "s" }, if app.save_path.is_some() { app.live_save_count.to_string() } else { "—".into() }),
|
||||
@@ -437,6 +439,8 @@ fn draw_status_dashboard(f: &mut Frame, area: Rect, app: &AppState) {
|
||||
f.render_widget(Paragraph::new(line), area);
|
||||
}
|
||||
|
||||
/// Render a scrollable picker list with description and prompt.
|
||||
#[allow(unused)]
|
||||
fn draw_select_list(
|
||||
f: &mut Frame,
|
||||
area: Rect,
|
||||
@@ -508,6 +512,7 @@ fn draw_select_list(
|
||||
}
|
||||
}
|
||||
|
||||
/// Render a picker list with an extra selected-item info line.
|
||||
fn draw_select_list_with_info(
|
||||
f: &mut Frame,
|
||||
area: Rect,
|
||||
@@ -599,6 +604,7 @@ fn draw_select_list_with_info(
|
||||
}
|
||||
}
|
||||
|
||||
/// Render the status bar at the bottom of the screen.
|
||||
fn draw_status_bar(f: &mut Frame, area: Rect, app: &AppState) {
|
||||
draw_whale_separator(f, area, app);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user