maybe_compress

Function maybe_compress 

Source
pub fn maybe_compress(data: &[u8]) -> Vec<u8> 
Expand description

Compress data with zstd, unless it’s already zstd-compressed.

Checks for zstd magic bytes at the start of the data to avoid double-compression. Returns original data if compression fails.