Skip to content

Commit

Permalink
sniff: explicitly declare sniff_error_json type; suppress lint warning
Browse files Browse the repository at this point in the history
  • Loading branch information
jqnatividad committed May 29, 2023
1 parent 1795d1a commit 3ff8726
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cmd/sniff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ async fn get_file_to_sniff(args: &Args, tmpdir: &tempfile::TempDir) -> CliResult
let wtr_file_path;
#[allow(unused_mut)]
let mut csv_candidate = true;
#[allow(unused_mut)]
let mut detected_mime = String::new();

#[cfg(all(target_os = "linux", feature = "magic"))]
Expand Down Expand Up @@ -781,6 +782,7 @@ pub async fn run(argv: &[&str]) -> CliResult<()> {
let sfile_info = block_on(future)?;
let tempfile_to_delete = sfile_info.file_to_sniff.clone();
#[allow(unused_assignments)]
#[allow(unused_mut)]
let mut file_type = String::new();

// on linux, check what kind of file we have
Expand Down Expand Up @@ -1050,7 +1052,7 @@ pub async fn run(argv: &[&str]) -> CliResult<()> {
};
Ok(())
} else {
let sniff_error_json;
let sniff_error_json: serde_json::Value = Default::default();
#[cfg(all(target_os = "linux", feature = "magic"))]
{
sniff_error_json = json!({
Expand Down

0 comments on commit 3ff8726

Please sign in to comment.