clean_dev_dirs/config/
scan.rs

1//! Scanning configuration for directory traversal.
2//!
3//! This module defines the options that control how directories are scanned
4//! and what information is collected during the scanning process.
5
6use std::path::PathBuf;
7
8/// Configuration for directory scanning behavior.
9///
10/// This struct contains options that control how directories are traversed
11/// and what information is collected during the scanning process.
12#[derive(Clone)]
13pub struct ScanOptions {
14    /// Whether to show verbose output including scan errors
15    pub verbose: bool,
16
17    /// Number of threads to use for scanning (0 = default)
18    pub threads: usize,
19
20    /// List of directory patterns to skip during scanning
21    pub skip: Vec<PathBuf>,
22}
23
24#[cfg(test)]
25mod tests {
26    use super::*;
27
28    #[test]
29    fn test_scan_options_creation() {
30        let scan_opts = ScanOptions {
31            verbose: true,
32            threads: 4,
33            skip: vec![PathBuf::from("test")],
34        };
35
36        assert!(scan_opts.verbose);
37        assert_eq!(scan_opts.threads, 4);
38        assert_eq!(scan_opts.skip.len(), 1);
39    }
40
41    #[test]
42    fn test_scan_options_clone() {
43        let original = ScanOptions {
44            verbose: true,
45            threads: 4,
46            skip: vec![PathBuf::from("test")],
47        };
48        let cloned = original.clone();
49
50        assert_eq!(original.verbose, cloned.verbose);
51        assert_eq!(original.threads, cloned.threads);
52        assert_eq!(original.skip, cloned.skip);
53    }
54}