@@ -16,12 +16,12 @@ pub struct DlpScanner {
1616 scan_responses : bool ,
1717}
1818
19- /// Result of scanning text for sensitive data.
19+ /// Result of scanning bytes for sensitive data.
2020#[ derive( Debug , Clone ) ]
2121pub struct ScanResult {
2222 /// Pattern names that matched with action=block.
2323 pub blocked : Vec < String > ,
24- /// The text with action=redact patterns replaced.
24+ /// The bytes with action=redact patterns replaced.
2525 pub redacted : Vec < u8 > ,
2626 /// Whether any redaction was applied.
2727 pub was_redacted : bool ,
@@ -61,7 +61,7 @@ impl DlpScanner {
6161 /// Returns a list of pattern names that matched with action=block (without including the actual sensitive data).
6262 #[ cfg( test) ]
6363 pub fn scan ( & self , body : & [ u8 ] ) -> Vec < String > {
64- trace ! ( text_len = body. len( ) , "Scanning text for block patterns" ) ;
64+ trace ! ( body_len = body. len( ) , "Scanning body for block patterns" ) ;
6565 let matches: Vec < String > = self
6666 . patterns
6767 . iter ( )
@@ -79,8 +79,8 @@ impl DlpScanner {
7979 /// Returns blocked pattern names and redacted body.
8080 pub fn scan_and_redact ( & self , body : & [ u8 ] ) -> ScanResult {
8181 trace ! (
82- text_len = body. len( ) ,
83- "Scanning text for block+redact patterns"
82+ body_len = body. len( ) ,
83+ "Scanning body for block+redact patterns"
8484 ) ;
8585 let blocked: Vec < String > = self
8686 . patterns
@@ -306,7 +306,7 @@ mod tests {
306306 }
307307
308308 #[ test]
309- fn test_redact_all_clean_text ( ) {
309+ fn test_redact_all_clean_bytes ( ) {
310310 let scanner = DlpScanner :: new ( & mixed_patterns ( ) ) . unwrap ( ) ;
311311 let ( redacted, names) = scanner. redact_all ( b"Hello, how are you?" ) ;
312312 assert ! ( names. is_empty( ) ) ;
0 commit comments