test: Updated Rust edition to 2024 and refactored network module tests to be more idiomatic

This commit is contained in:
2025-12-03 14:49:27 -07:00
parent c4e8d64710
commit ad58912baf
257 changed files with 4033 additions and 4380 deletions
+9 -9
View File
@@ -1,35 +1,35 @@
use anyhow::Result;
use clap::{crate_authors, crate_description, crate_name, crate_version, CommandFactory, Parser};
use clap::{CommandFactory, Parser, crate_authors, crate_description, crate_name, crate_version};
use clap_complete::generate;
use crossterm::execute;
use crossterm::terminal::{
disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen,
EnterAlternateScreen, LeaveAlternateScreen, disable_raw_mode, enable_raw_mode,
};
use log::{debug, error, warn};
use network::NetworkTrait;
use ratatui::backend::CrosstermBackend;
use ratatui::Terminal;
use ratatui::backend::CrosstermBackend;
use reqwest::Client;
use std::panic::PanicHookInfo;
use std::path::PathBuf;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
use std::sync::atomic::{AtomicBool, Ordering};
use std::{io, panic, process};
use tokio::select;
use tokio::sync::mpsc::Receiver;
use tokio::sync::{mpsc, Mutex};
use tokio::sync::{Mutex, mpsc};
use tokio_util::sync::CancellationToken;
use utils::{
build_network_client, load_config, start_cli_no_spinner, start_cli_with_spinner, tail_logs,
};
use crate::app::{log_and_print_error, App};
use crate::app::{App, log_and_print_error};
use crate::cli::Command;
use crate::event::input_event::{Events, InputEvent};
use crate::event::Key;
use crate::event::input_event::{Events, InputEvent};
use crate::network::{Network, NetworkEvent};
use crate::ui::theme::{Theme, ThemeDefinitionsWrapper};
use crate::ui::{ui, THEME};
use crate::ui::{THEME, ui};
use crate::utils::load_theme_config;
mod app;
@@ -203,7 +203,7 @@ async fn start_ui(
themes_file_arg: &Option<PathBuf>,
theme_name: String,
) -> Result<()> {
let theme_definitions_wrapper = if let Some(ref theme_file) = themes_file_arg {
let theme_definitions_wrapper = if let Some(theme_file) = themes_file_arg {
load_theme_config(theme_file.to_str().expect("Invalid theme file specified"))?
} else {
confy::load("managarr", "themes").unwrap_or_else(|_| ThemeDefinitionsWrapper::default())