fn make_next_command(&self, chunk: &project::Chunk) -> Option<()> {

        match &chunk.state {
            NOT_STARTED => {
                println!("Submitting split command!");
                self.dispatcher.push(commands::make_split(&self.project, chunk.clone()));
                return Some(());
            }
            SPLIT => {
                println!("Submitting pass1 command!");
                self.dispatcher.push(commands::make_pass1(&self.project, chunk.clone()));
                return Some(());
            }
            PASS_1 => {
                println!("Submitting pass2 command!");
                self.dispatcher.push(commands::make_pass2(&self.project, chunk.clone()));
                return Some(());
            }
            // Anything else is marked as completed or pass2, effectively the same thing
            _ => return None,
        }

    }
// Create the next approprate command based on our current chunk state
Create the next approprate command based on our current chunk state
Create the next approprate command based on our current chunk state
fn make_next_command(&self, chunk: &project::Chunk) -> Option<()> {
        match &chunk.state {
            NOT_STARTED => {
                println!("Submitting split command!");
                self.dispatcher.push(commands::make_split(&self.project, chunk.clone()));
                return Some(());
            }
            SPLIT => {
                println!("Submitting pass1 command!");
                self.dispatcher.push(commands::make_pass1(&self.project, chunk.clone()));
                return Some(());
            }
            PASS_1 => {
                println!("Submitting pass2 command!");
                self.dispatcher.push(commands::make_pass2(&self.project, chunk.clone()));
                return Some(());
            }
            // Anything else is marked as completed or pass2, effectively the same thing
            _ => return None,
        }
    }
fn make_next_command ( & self , chunk : & project :: Chunk ) -> Option < ( ) > { match & chunk . state { NOT_STARTED => { println ! ( " " ) ; self . dispatcher . push ( commands :: make_split ( & self . project , chunk . clone ( ) ) ) ; return Some ( ( ) ) ; } SPLIT => { println ! ( " " ) ; self . dispatcher . push ( commands :: make_pass1 ( & self . project , chunk . clone ( ) ) ) ; return Some ( ( ) ) ; } PASS_1 => { println ! ( " " ) ; self . dispatcher . push ( commands :: make_pass2 ( & self . project , chunk . clone ( ) ) ) ; return Some ( ( ) ) ; } // Anything else is marked as completed or pass2, effectively the same thing _ => return None , } }
Create the next approprate command based on our current chunk state
Create the next approprate command based on our current chunk state
&self
chunk
&project::Chunk
&self
chunk
&project::Chunk