ttencate commented on code in PR #6271:
URL: https://github.com/apache/arrow-rs/pull/6271#discussion_r1722772691


##########
parquet/src/basic.rs:
##########
@@ -358,6 +358,14 @@ pub enum Compression {
     LZ4_RAW,
 }
 
+impl Compression {
+    /// Returns the codec type of this compression setting as a string, 
without the compression
+    /// level.
+    pub(crate) fn codec_to_string(self) -> String {
+        format!("{:?}", self).split('(').next().unwrap().to_owned()

Review Comment:
   If there is no `(`, then `split()` will return just one component – the 
entire string (even if it's empty). There is no way this can panic. But I've 
added a test anyway.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to