(
ops: &[FileOps],
content: &[u8],
split: bool,
)
| 133 | } |
| 134 | |
| 135 | fn compressed_compact( |
| 136 | ops: &[FileOps], |
| 137 | content: &[u8], |
| 138 | split: bool, |
| 139 | ) -> FormatResult<SelectedSemantic> { |
| 140 | let payload = encode::encode_layout(ops, content, split)?; |
| 141 | let compressed = zstd::encode_all(payload.as_slice(), 3) |
| 142 | .map_err(|e| FormatError::Compress(e.to_string()))?; |
| 143 | if compressed.len() > wire::MAX_PAYLOAD { |
| 144 | return Err(FormatError::SemanticLimitExceeded); |
| 145 | } |
| 146 | Ok(SelectedSemantic { |
| 147 | compact: true, |
| 148 | predictive: false, |
| 149 | compressed, |
| 150 | uncompressed_len: payload.len(), |
| 151 | fallback: None, |
| 152 | }) |
| 153 | } |
no test coverage detected