fn remove_last(&mut self) -> Result<()> {
        if let Some((_, file_key)) = self.files.pop_front() {
            let file_path = self.entry_path(file_key);
            let file_size = fs::metadata(&file_path)?.len();
            fs::remove_file(file_path)?;
            self.num_files -= 1;
            self.size -= file_size;
        }
        Ok(())
    }
// This works only on *nix, as one can delete safely opened files, Windows might require bit different approach
This works only on *nix, as one can delete safely opened files, Windows might require bit different approach
This works only on * nix as one can delete safely opened files Windows might require bit different approach
fn remove_last(&mut self) -> Result<()> {
        if let Some((_, file_key)) = self.files.pop_front() {
            let file_path = self.entry_path(file_key);
            let file_size = fs::metadata(&file_path)?.len();
            fs::remove_file(file_path)?;
            self.num_files -= 1;
            self.size -= file_size;
        }
        Ok(())
    }
fn remove_last ( & mut self ) -> Result < ( ) > { if let Some ( ( _ , file_key ) ) = self . files . pop_front ( ) { let file_path = self . entry_path ( file_key ) ; let file_size = fs :: metadata ( & file_path ) ? . len ( ) ; fs :: remove_file ( file_path ) ? ; self . num_files -= 1 ; self . size -= file_size ; } Ok ( ( ) ) }
This works only on *nix, as one can delete safely opened files, Windows might require bit different approach
This works only on * nix as one can delete safely opened files Windows might require bit different approach
&mut self
&mut self