Skip to content

Commit 82e9eeb

Browse files
committed
Put Ok(()) branch first
1 parent 2022c93 commit 82e9eeb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/iceberg/src/puffin/metadata.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ impl FileMetadata {
137137
FileMetadata::FOOTER_STRUCT_MAGIC_OFFSET + FileMetadata::MAGIC_LENGTH;
138138

139139
fn check_magic(bytes: &[u8]) -> Result<()> {
140-
if bytes != FileMetadata::MAGIC {
140+
if bytes == FileMetadata::MAGIC {
141+
Ok(())
142+
} else {
141143
Err(Error::new(
142144
ErrorKind::DataInvalid,
143145
format!(
@@ -146,8 +148,6 @@ impl FileMetadata {
146148
FileMetadata::MAGIC
147149
),
148150
))
149-
} else {
150-
Ok(())
151151
}
152152
}
153153

0 commit comments

Comments
 (0)