MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / space_savings_pct

Method space_savings_pct

atomic-core/src/change/format_v3/chunking.rs:327–332  ·  view source on GitHub ↗

Returns the space savings as a percentage (0.0 to 100.0).

(&self)

Source from the content-addressed store, hash-verified

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
335impl fmt::Display for CompressedChunk {

Callers

nothing calls this directly

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected