fn next_job(&mut self) -> Option<(Job<C, E>, usize)> {
        if self.ready.len() == 0 {
            return None;
        }

        let idx = self.ready.remove(0);
        let state = mem::replace(&mut self.jobs[idx].state, State::Running);

        if let State::Pending(job) = state {
            Some((job, idx))
        } else {
            panic!("unexpected job status")
        }
    }
/// Returns the next job from the ready queue, along with its index
Returns the next job from the ready queue, along with its index
Returns the next job from the ready queue along with its index
fn next_job(&mut self) -> Option<(Job<C, E>, usize)> {
        if self.ready.len() == 0 {
            return None;
        }
        let idx = self.ready.remove(0);
        let state = mem::replace(&mut self.jobs[idx].state, State::Running);
        if let State::Pending(job) = state {
            Some((job, idx))
        } else {
            panic!("unexpected job status")
        }
    }
fn next_job ( & mut self ) -> Option < ( Job < C , E > , usize ) > { if self . ready . len ( ) == 0 { return None ; } let idx = self . ready . remove ( 0 ) ; let state = mem :: replace ( & mut self . jobs [ idx ] . state , State :: Running ) ; if let State :: Pending ( job ) = state { Some ( ( job , idx ) ) } else { panic ! ( " " ) } }
Returns the next job from the ready queue, along with its index
Returns the next job from the ready queue along with its index
&mut self