Returns the space savings as a percentage (0.0 to 100.0).
(&self)
| 325 | |
| 326 | /// Returns the space savings as a percentage (0.0 to 100.0). |
| 327 | pub fn space_savings_pct(&self) -> f64 { |
| 328 | if self.chunk.length == 0 { |
| 329 | return 0.0; |
| 330 | } |
| 331 | (1.0 - self.compressed_data.len() as f64 / self.chunk.length as f64) * 100.0 |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | impl fmt::Display for CompressedChunk { |