@@ -7,22 +7,21 @@ use anyhow::Result;
77
88/// Event enricher
99pub struct EventEnricher {
10- // Cache for process information
11- process_cache : std:: collections:: HashMap < u32 , ProcessInfo > ,
10+ _process_cache : std:: collections:: HashMap < u32 , ProcessInfo > ,
1211}
1312
1413#[ derive( Debug , Clone ) ]
1514struct ProcessInfo {
16- pid : u32 ,
17- ppid : u32 ,
18- comm : Option < String > ,
15+ _pid : u32 ,
16+ _ppid : u32 ,
17+ _comm : Option < String > ,
1918}
2019
2120impl EventEnricher {
2221 /// Create a new event enricher
2322 pub fn new ( ) -> Result < Self > {
2423 Ok ( Self {
25- process_cache : std:: collections:: HashMap :: new ( ) ,
24+ _process_cache : std:: collections:: HashMap :: new ( ) ,
2625 } )
2726 }
2827
@@ -44,11 +43,11 @@ impl EventEnricher {
4443 }
4544
4645 /// Get parent PID for a process
47- pub fn get_parent_pid ( & self , pid : u32 ) -> Option < u32 > {
46+ pub fn get_parent_pid ( & self , _pid : u32 ) -> Option < u32 > {
4847 #[ cfg( target_os = "linux" ) ]
4948 {
5049 // Read from /proc/[pid]/stat
51- let stat_path = format ! ( "/proc/{}/stat" , pid ) ;
50+ let stat_path = format ! ( "/proc/{}/stat" , _pid ) ;
5251 if let Ok ( content) = std:: fs:: read_to_string ( & stat_path) {
5352 // Parse ppid from stat file (field 4)
5453 let parts: Vec < & str > = content. split_whitespace ( ) . collect ( ) ;
@@ -64,11 +63,11 @@ impl EventEnricher {
6463 }
6564
6665 /// Get process command name
67- pub fn get_process_comm ( & self , pid : u32 ) -> Option < String > {
66+ pub fn get_process_comm ( & self , _pid : u32 ) -> Option < String > {
6867 #[ cfg( target_os = "linux" ) ]
6968 {
7069 // Read from /proc/[pid]/comm
71- let comm_path = format ! ( "/proc/{}/comm" , pid ) ;
70+ let comm_path = format ! ( "/proc/{}/comm" , _pid ) ;
7271 if let Ok ( content) = std:: fs:: read_to_string ( & comm_path) {
7372 return Some ( content. trim ( ) . to_string ( ) ) ;
7473 }
@@ -91,11 +90,11 @@ impl EventEnricher {
9190 }
9291
9392 /// Get process executable path
94- pub fn get_process_exe ( & self , pid : u32 ) -> Option < String > {
93+ pub fn get_process_exe ( & self , _pid : u32 ) -> Option < String > {
9594 #[ cfg( target_os = "linux" ) ]
9695 {
9796 // Read symlink /proc/[pid]/exe
98- let exe_path = format ! ( "/proc/{}/exe" , pid ) ;
97+ let exe_path = format ! ( "/proc/{}/exe" , _pid ) ;
9998 if let Ok ( path) = std:: fs:: read_link ( & exe_path) {
10099 return path. to_str ( ) . map ( |s| s. to_string ( ) ) ;
101100 }
@@ -105,11 +104,11 @@ impl EventEnricher {
105104 }
106105
107106 /// Get process working directory
108- pub fn get_process_cwd ( & self , pid : u32 ) -> Option < String > {
107+ pub fn get_process_cwd ( & self , _pid : u32 ) -> Option < String > {
109108 #[ cfg( target_os = "linux" ) ]
110109 {
111110 // Read symlink /proc/[pid]/cwd
112- let cwd_path = format ! ( "/proc/{}/cwd" , pid ) ;
111+ let cwd_path = format ! ( "/proc/{}/cwd" , _pid ) ;
113112 if let Ok ( path) = std:: fs:: read_link ( & cwd_path) {
114113 return path. to_str ( ) . map ( |s| s. to_string ( ) ) ;
115114 }
0 commit comments