Skip to content

Commit d7b25c8

Browse files
author
ChanTsune
committed
🎨 Fix formatting and avoid debug-printing self in build() panic
1 parent 3fd6bfb commit d7b25c8

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

lib/src/entry/options.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -895,9 +895,9 @@ impl WriteOptionsBuilder {
895895
match self.encryption {
896896
Encryption::Aes => CipherAlgorithm::Aes,
897897
Encryption::Camellia => CipherAlgorithm::Camellia,
898-
_ => panic!(
899-
"unsupported encryption method for writing: {:?}",
900-
self.encryption
898+
other => panic!(
899+
"unsupported encryption method for writing: byte={}",
900+
other.to_byte()
901901
),
902902
},
903903
self.cipher_mode,
@@ -911,9 +911,9 @@ impl WriteOptionsBuilder {
911911
Compression::Deflate => Compress::Deflate(self.compression_level.into()),
912912
Compression::ZStandard => Compress::ZStandard(self.compression_level.into()),
913913
Compression::XZ => Compress::XZ(self.compression_level.into()),
914-
_ => panic!(
915-
"unsupported compression method for writing: {:?}",
916-
self.compression
914+
other => panic!(
915+
"unsupported compression method for writing: byte={}",
916+
other.to_byte()
917917
),
918918
},
919919
cipher,

lib/src/entry/read.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ pub(crate) fn decrypt_reader<R: Read>(
6262
return Err(io::Error::new(
6363
io::ErrorKind::Unsupported,
6464
format!("unsupported encryption method: {encryption:?}"),
65-
))
65+
));
6666
}
6767
})
6868
}
@@ -86,7 +86,7 @@ pub(crate) fn decompress_reader<R: Read>(
8686
return Err(io::Error::new(
8787
io::ErrorKind::Unsupported,
8888
format!("unsupported compression method: {compression:?}"),
89-
))
89+
));
9090
}
9191
})
9292
}

lib/src/entry/write.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ fn encryption_writer<W: Write>(
165165
return Err(io::Error::new(
166166
io::ErrorKind::Unsupported,
167167
format!("unsupported cipher mode for writing: {:?}", context.mode),
168-
))
168+
));
169169
}
170170
})
171171
}

0 commit comments

Comments
 (0)