Skip to content

Commit

Permalink
Reference the magic number for later
Browse files Browse the repository at this point in the history
  • Loading branch information
jssblck committed Jun 5, 2024
1 parent eab09b5 commit 197fed4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/fingerprint/jar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ pub fn class(stream: impl BufRead + Seek) -> Result<Option<Fingerprint>, Error>

#[tracing::instrument(level = tracing::Level::DEBUG, fields(entry = ?entry.name()), ret)]
fn is_class_file(entry: &ZipFile<'_>) -> bool {
// If this becomes a problem in the future we can use the magic number instead:
// https://en.wikipedia.org/wiki/Java_class_file#Magic_Number
entry.name().ends_with(".class")
}

Expand Down

0 comments on commit 197fed4

Please sign in to comment.