Skip to content

Commit 0ea1456

Browse files
committed
ostree-ext: unencapsulate: Fix goofy match usage
Leftovers from the refactor in ostreedev/ostree-rs-ext#677 Signed-off-by: John Eckersberg <[email protected]>
1 parent da32b29 commit 0ea1456

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

ostree-ext/src/container/unencapsulate.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -197,15 +197,10 @@ pub(crate) fn decompressor(
197197
src: impl Read + Send + 'static,
198198
) -> Result<Box<dyn Read + Send + 'static>> {
199199
let r: Box<dyn std::io::Read + Send + 'static> = match media_type {
200-
m @ (oci_image::MediaType::ImageLayerGzip | oci_image::MediaType::ImageLayerZstd) => {
201-
if matches!(m, oci_image::MediaType::ImageLayerZstd) {
202-
Box::new(zstd::stream::read::Decoder::new(src)?)
203-
} else {
204-
Box::new(flate2::bufread::GzDecoder::new(std::io::BufReader::new(
205-
src,
206-
)))
207-
}
208-
}
200+
oci_image::MediaType::ImageLayerZstd => Box::new(zstd::stream::read::Decoder::new(src)?),
201+
oci_image::MediaType::ImageLayerGzip => Box::new(flate2::bufread::GzDecoder::new(
202+
std::io::BufReader::new(src),
203+
)),
209204
oci_image::MediaType::ImageLayer => Box::new(src),
210205
oci_image::MediaType::Other(t) if t.as_str() == DOCKER_TYPE_LAYER_TAR => Box::new(src),
211206
o => anyhow::bail!("Unhandled layer type: {}", o),

0 commit comments

Comments
 (0)