Skip to content

Commit

Permalink
Fix some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
codervijo committed Feb 1, 2025
1 parent 513dc79 commit ed2e691
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 12 deletions.
22 changes: 11 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/jview_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ pub mod settings {
}

// Atomic values for thread-safe primitive types
#[allow(dead_code)]
static MAX_CONNECTIONS: AtomicUsize = AtomicUsize::new(10);
#[allow(dead_code)]
static LOGGING_ENABLED: AtomicBool = AtomicBool::new(true);

/// Set the username
Expand All @@ -33,21 +35,25 @@ pub mod settings {
}

/// Set the maximum number of connections
#[allow(dead_code)]
pub fn set_max_connections(value: usize) {
MAX_CONNECTIONS.store(value, Ordering::SeqCst);
}

/// Get the maximum number of connections
#[allow(dead_code)]
pub fn get_max_connections() -> usize {
MAX_CONNECTIONS.load(Ordering::SeqCst)
}

/// Enable or disable logging
#[allow(dead_code)]
pub fn set_logging_enabled(enabled: bool) {
LOGGING_ENABLED.store(enabled, Ordering::SeqCst);
}

/// Check if logging is enabled
#[allow(dead_code)]
pub fn is_logging_enabled() -> bool {
LOGGING_ENABLED.load(Ordering::SeqCst)
}
Expand Down
4 changes: 3 additions & 1 deletion src/jview_debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ pub fn init_debug_log() {
}

/// Shutdown and flush the logs before exiting
#[allow(dead_code)]
pub fn shutdown_debug_log() {
if let Some(ref file_mutex) = LOGGER.file.as_ref() {
if let Ok(mut file) = file_mutex.lock() {
Expand All @@ -89,11 +90,12 @@ pub fn log_debug_info(message: &str, args: Arguments) {
LOGGER.flush();
}


#[allow(dead_code)]
pub fn log_debug_warn(message: String) {
log::warn!("{}", message);
}

#[allow(dead_code)]
pub fn log_debug_error(message: String) {
log::error!("{}", message);
}
1 change: 1 addition & 0 deletions src/jview_logs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use ratatui::{
};
use ratatui::style;
use crossterm::event::{self, Event, KeyCode};
#[allow(unused_imports)]
use crate::jview_config;
use crate::jview_config::settings;
use crate::jview_debug;
Expand Down
1 change: 1 addition & 0 deletions src/jview_screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pub enum UiSection {
Search,
Logs,
Selector,
#[allow(dead_code)]
Help,
}

Expand Down
1 change: 1 addition & 0 deletions src/jview_selector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use ratatui::{
};
use crossterm::event::{self, Event, KeyCode};
use std::process::Command;
#[allow(unused_imports)]
use crate::jview_config;
use crate::jview_config::settings;
use crate::jview_debug;
Expand Down

0 comments on commit ed2e691

Please sign in to comment.