refactor: move conversion code to utils (#1671)

This commit is contained in:
Clement Tsang 2025-02-06 20:54:03 -05:00 committed by GitHub
parent a82d8578cf
commit ec1a4cb7e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View File

@ -10,6 +10,7 @@
pub(crate) mod app; pub(crate) mod app;
mod utils { mod utils {
pub(crate) mod cancellation_token; pub(crate) mod cancellation_token;
pub(crate) mod conversion;
pub(crate) mod data_units; pub(crate) mod data_units;
pub(crate) mod general; pub(crate) mod general;
pub(crate) mod logging; pub(crate) mod logging;
@ -18,7 +19,6 @@ mod utils {
pub(crate) mod canvas; pub(crate) mod canvas;
pub(crate) mod collection; pub(crate) mod collection;
pub(crate) mod constants; pub(crate) mod constants;
pub(crate) mod data_conversion;
pub(crate) mod event; pub(crate) mod event;
pub mod options; pub mod options;
pub mod widgets; pub mod widgets;
@ -45,11 +45,11 @@ use crossterm::{
execute, execute,
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen}, terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
}; };
use data_conversion::*;
use event::{handle_key_event_or_break, handle_mouse_event, BottomEvent, CollectionThreadEvent}; use event::{handle_key_event_or_break, handle_mouse_event, BottomEvent, CollectionThreadEvent};
use options::{args, get_or_create_config, init_app}; use options::{args, get_or_create_config, init_app};
use tui::{backend::CrosstermBackend, Terminal}; use tui::{backend::CrosstermBackend, Terminal};
use utils::cancellation_token::CancellationToken; use utils::cancellation_token::CancellationToken;
use utils::conversion::*;
#[allow(unused_imports, reason = "this is needed if logging is enabled")] #[allow(unused_imports, reason = "this is needed if logging is enabled")]
use utils::logging::*; use utils::logging::*;

View File

@ -16,7 +16,7 @@ use crate::{
Painter, Painter,
}, },
collection::processes::{Pid, ProcessHarvest}, collection::processes::{Pid, ProcessHarvest},
data_conversion::dec_bytes_per_second_string, dec_bytes_per_second_string,
utils::data_units::{get_binary_bytes, get_decimal_bytes, GIBI_LIMIT, GIGA_LIMIT}, utils::data_units::{get_binary_bytes, get_decimal_bytes, GIBI_LIMIT, GIGA_LIMIT},
}; };