pub fn find_process_id_by_process_name(process_name: &str) -> Option<u32> {
    let mut system = sysinfo::System::new_all();
    system.refresh_all();

    let processes = system.get_processes();
    processes
        .into_iter()
        .find(|(_pid, proc)| proc.name() == process_name)
        .map(|(pid, _)| *pid as u32)
}
/// Finds the process id of a process by its name
/// `process_name` The name of the process
Finds the process id of a process by its name
`process_name` The name of the process
Finds the process id of a process by its name ` process_name ` The name of the process
pub fn find_process_id_by_process_name(process_name: &str) -> Option<u32> {
    let mut system = sysinfo::System::new_all();
    system.refresh_all();
    let processes = system.get_processes();
    processes
        .into_iter()
        .find(|(_pid, proc)| proc.name() == process_name)
        .map(|(pid, _)| *pid as u32)
}
pub fn find_process_id_by_process_name ( process_name : & str ) -> Option < u32 > { let mut system = sysinfo :: System :: new_all ( ) ; system . refresh_all ( ) ; let processes = system . get_processes ( ) ; processes . into_iter ( ) . find ( | ( _pid , proc ) | proc . name ( ) == process_name ) . map ( | ( pid , _ ) | * pid as u32 ) }
Finds the process id of a process by its name
`process_name` The name of the process
Finds the process id of a process by its name ` process_name ` The name of the process
process_name
&str
process_name
&str