Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Adam Reeve <[email protected]>
  • Loading branch information
rok and adamreeve authored Mar 10, 2025
1 parent 276fc1a commit c805b51
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions parquet/src/encryption/decryption.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,7 @@ impl FileDecryptor {
let file_aad = [aad_prefix.as_slice(), aad_file_unique.as_slice()].concat();
// todo decr: if no key available yet (not set in properties, should be retrieved from metadata)
let footer_decryptor = RingGcmBlockDecryptor::new(&decryption_properties.footer_key)
.map_err(|e| {
let msg = String::from("Invalid footer key. ")
+ e.to_string().replace("Parquet error: ", "").as_str();
ParquetError::General(msg)
.map_err(|e| general_err!("Invalid footer key. {}", e.to_string().replace("Parquet error: ", "")))?;
})?;

Ok(Self {
Expand Down
4 changes: 2 additions & 2 deletions parquet/src/file/metadata/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ impl ParquetMetaData {

/// Returns file decryptor as reference.
#[cfg(feature = "encryption")]
pub fn file_decryptor(&self) -> &Option<FileDecryptor> {
&self.file_decryptor
pub fn file_decryptor(&self) -> Option<&FileDecryptor> {
self.file_decryptor.as_ref()
}

/// Returns number of row groups in this file.
Expand Down

0 comments on commit c805b51

Please sign in to comment.