pub fn update_chunk(&mut self, newchunk: Chunk) {

        for chunk in self.chunks.iter_mut() {
            if newchunk.scene_number == chunk.scene_number {
                println!("replacing chunk {}\n{:?}", chunk.scene_number, newchunk);
                *chunk = newchunk;
                return;
            }
        }
        // if we got here, it means that we didn't find our chunk
        panic!("We didn't find a chunk to update!");

    }
// TODO: when writing error behavior, this needs to return an error instead of panic
when writing error behavior, this needs to return an error instead of panic
when writing error behavior this needs to return an error instead of panic
pub fn update_chunk(&mut self, newchunk: Chunk) {
        for chunk in self.chunks.iter_mut() {
            if newchunk.scene_number == chunk.scene_number {
                println!("replacing chunk {}\n{:?}", chunk.scene_number, newchunk);
                *chunk = newchunk;
                return;
            }
        }
        // if we got here, it means that we didn't find our chunk
        panic!("We didn't find a chunk to update!");
    }
pub fn update_chunk ( & mut self , newchunk : Chunk ) { for chunk in self . chunks . iter_mut ( ) { if newchunk . scene_number == chunk . scene_number { println ! ( " \n " chunk scene_number newchunk ) ; * chunk = newchunk ; return ; } } // if we got here, it means that we didn't find our chunk panic ! ( " " ) ; }
TODO: when writing error behavior, this needs to return an error instead of panic
TODO : when writing error behavior this needs to return an error instead of panic
&mut self
newchunk
Chunk
&mut self
newchunk
Chunk