Fix all clippy lints and pass CI checks
- Box large enum variants in EventData to reduce memory footprint - Add Default trait implementations for types with new() methods - Replace or_insert_with(Vec::new) with or_default() - Convert vec init+push patterns to vec! macro - Fix field reassignment with default initialization - Convert match to if for simple equality checks - Remove unused Backend type parameters from TUI draw functions - Apply rustfmt formatting All tests passing (24 total). Zero clippy warnings. Ready for CI/CD.
This commit is contained in:
@@ -139,8 +139,10 @@ mod tests {
|
||||
let config = DetectionConfig::default();
|
||||
assert!(config.validate().is_ok());
|
||||
|
||||
let mut invalid_config = DetectionConfig::default();
|
||||
invalid_config.confidence_threshold = 1.5; // Invalid
|
||||
let mut invalid_config = DetectionConfig {
|
||||
confidence_threshold: 1.5, // Invalid
|
||||
..Default::default()
|
||||
};
|
||||
assert!(invalid_config.validate().is_err());
|
||||
|
||||
invalid_config.confidence_threshold = -0.1; // Invalid
|
||||
@@ -165,8 +167,10 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_engine_with_custom_config() {
|
||||
let mut config = DetectionConfig::default();
|
||||
config.hook_detection = false;
|
||||
let config = DetectionConfig {
|
||||
hook_detection: false,
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
let mut engine =
|
||||
DetectionEngine::with_config(Some(config)).expect("Failed to create engine");
|
||||
|
||||
Reference in New Issue
Block a user