Skip to content

Commit

Permalink
snappy: wordsmith check implementation comments
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
jqnatividad committed Jun 6, 2023
1 parent 534e30f commit 832d16a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cmd/snappy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ fn decompress<R: Read, W: Write>(src: R, mut dst: W) -> CliResult<u64> {
fn check<R: Read>(src: R) -> bool {
let src = snap::read::FrameDecoder::new(src);

// read the first 50 or less bytes of a file
// the snap decoder will return an error if the file is not a valid snappy file
// read the first 50 or less bytes of a file. The snap decoder will return an error
// if the file does not start with a valid snappy header
let mut buffer = Vec::with_capacity(50);
src.take(50).read_to_end(&mut buffer).is_ok()
}
Expand Down

0 comments on commit 832d16a

Please sign in to comment.