pub fn deserialise(&mut self, file: &str) -> Option<Chunk> {
        let data_res = fs::read(file);
        match data_res {
            Ok(data) => {
                let data_chars: &[u8] = &&data;
                let decoded_res = bincode::deserialize(data_chars);
                match decoded_res {
                    Ok(decoded) => {
                        return Some(decoded);
                    }
                    Err(_) => {
                        return None;
                    }
                }
            }
            Err(_) => {
                return None;
            }
        }
    }
/// Takes a file path as its single argument.  Deserialises a
/// chunk from that file and returns the chunk.
Takes a file path as its single argument.  Deserialises a
chunk from that file and returns the chunk.
Takes a file path as its single argument . Deserialises a chunk from that file and returns the chunk .
pub fn deserialise(&mut self, file: &str) -> Option<Chunk> {
        let data_res = fs::read(file);
        match data_res {
            Ok(data) => {
                let data_chars: &[u8] = &&data;
                let decoded_res = bincode::deserialize(data_chars);
                match decoded_res {
                    Ok(decoded) => {
                        return Some(decoded);
                    }
                    Err(_) => {
                        return None;
                    }
                }
            }
            Err(_) => {
                return None;
            }
        }
    }
pub fn deserialise ( & mut self , file : & str ) -> Option < Chunk > { let data_res = fs :: read ( file ) ; match data_res { Ok ( data ) => { let data_chars : & [ u8 ] = & & data ; let decoded_res = bincode :: deserialize ( data_chars ) ; match decoded_res { Ok ( decoded ) => { return Some ( decoded ) ; } Err ( _ ) => { return None ; } } } Err ( _ ) => { return None ; } } }
Takes a file path as its single argument.
Takes a file path as its single argument .
&mut self
file
&str