pub fn remove_pid_from_job(&mut self, pid: Pid, pgid: Pid) 
    -> Option<JobTrack> {
        let mut pids_empty = false;
        let mut jobid = 0;
        for (id, job) in self.jobs.iter_mut() {
            if pgid == job.pgid {
                if let Ok(idx) = job.pids.binary_search(&pid) {
                    job.pids.remove(idx);
                }
                pids_empty = job.pids.is_empty();
                jobid = *id;
            }
        }
        if pids_empty {
            return self.jobs.remove(&jobid);
        }
        None
    }
/// Returns the job. Returns None if it doesn't exist.
Returns the job. Returns None if it doesn't exist.
Returns the job . Returns None if it doesn ' t exist .
pub fn remove_pid_from_job(&mut self, pid: Pid, pgid: Pid) 
    -> Option<JobTrack> {
        let mut pids_empty = false;
        let mut jobid = 0;
        for (id, job) in self.jobs.iter_mut() {
            if pgid == job.pgid {
                if let Ok(idx) = job.pids.binary_search(&pid) {
                    job.pids.remove(idx);
                }
                pids_empty = job.pids.is_empty();
                jobid = *id;
            }
        }
        if pids_empty {
            return self.jobs.remove(&jobid);
        }
        None
    }
pub fn remove_pid_from_job ( & mut self , pid : Pid , pgid : Pid ) -> Option < JobTrack > { let mut pids_empty = false ; let mut jobid = 0 ; for ( id , job ) in self . jobs . iter_mut ( ) { if pgid == job . pgid { if let Ok ( idx ) = job . pids . binary_search ( & pid ) { job . pids . remove ( idx ) ; } pids_empty = job . pids . is_empty ( ) ; jobid = * id ; } } if pids_empty { return self . jobs . remove ( & jobid ) ; } None }
Returns the job.
Returns the job .
&mut self
pid
Pid
pgid
Pid