mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-05-27 01:54:46 -07:00
Removed redundant annotations inlined the defaults
This commit is contained in:
@@ -20,22 +20,10 @@ pub struct Config {
|
|||||||
pub ntfy_url: Option<String>,
|
pub ntfy_url: Option<String>,
|
||||||
pub enabled_notifications: Vec<NotificationType>,
|
pub enabled_notifications: Vec<NotificationType>,
|
||||||
pub analyzers: AnalyzerConfig,
|
pub analyzers: AnalyzerConfig,
|
||||||
/// Minimum disk space (MB) required to start recording
|
|
||||||
#[serde(default = "default_min_space_to_start_recording_mb")]
|
|
||||||
pub min_space_to_start_recording_mb: u64,
|
pub min_space_to_start_recording_mb: u64,
|
||||||
/// Minimum disk space (MB) to continue recording (stops if below this)
|
|
||||||
#[serde(default = "default_min_space_to_continue_recording_mb")]
|
|
||||||
pub min_space_to_continue_recording_mb: u64,
|
pub min_space_to_continue_recording_mb: u64,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn default_min_space_to_start_recording_mb() -> u64 {
|
|
||||||
1
|
|
||||||
}
|
|
||||||
|
|
||||||
fn default_min_space_to_continue_recording_mb() -> u64 {
|
|
||||||
1
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Default for Config {
|
impl Default for Config {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Config {
|
Config {
|
||||||
@@ -49,8 +37,8 @@ impl Default for Config {
|
|||||||
analyzers: AnalyzerConfig::default(),
|
analyzers: AnalyzerConfig::default(),
|
||||||
ntfy_url: None,
|
ntfy_url: None,
|
||||||
enabled_notifications: vec![NotificationType::Warning, NotificationType::LowBattery],
|
enabled_notifications: vec![NotificationType::Warning, NotificationType::LowBattery],
|
||||||
min_space_to_start_recording_mb: default_min_space_to_start_recording_mb(),
|
min_space_to_start_recording_mb: 1,
|
||||||
min_space_to_continue_recording_mb: default_min_space_to_continue_recording_mb(),
|
min_space_to_continue_recording_mb: 1,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user