Skip to content

Commit

Permalink
sniff: add conditional compilation directives for downloaded_lines
Browse files Browse the repository at this point in the history
as we ignore --progressbar option in qsvdp variant and downloaded_lines, which is used in progressbar messages, is not needed
  • Loading branch information
jqnatividad committed Nov 18, 2023
1 parent 97d2e1d commit 402cb98
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cmd/sniff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ async fn get_file_to_sniff(args: &Args, tmpdir: &tempfile::TempDir) -> CliResult
let mut file = NamedTempFile::new()?;
let mut downloaded = 0_usize;
let mut stream = res.bytes_stream();
#[cfg(any(feature = "feature_capable", feature = "lite"))]
let mut downloaded_lines = 0_usize;
#[allow(unused_assignments)]
let mut chunk = Bytes::new(); // amortize the allocation
Expand Down Expand Up @@ -454,6 +455,7 @@ async fn get_file_to_sniff(args: &Args, tmpdir: &tempfile::TempDir) -> CliResult
}

// check if we're downloading the entire file
#[cfg(any(feature = "feature_capable", feature = "lite"))]
if lines_sample_size != usize::MAX {
// we're not downloading the entire file, so we need to
// scan chunk for newlines
Expand Down

0 comments on commit 402cb98

Please sign in to comment.