Skip to content

Commit

Permalink
remove unneeded clippy allow; redundant else block
Browse files Browse the repository at this point in the history
  • Loading branch information
jqnatividad committed Oct 13, 2022
1 parent aa1f976 commit 956791f
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/cmd/jsonl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ fn recurse_to_infer_headers(value: &Value, headers: &mut Vec<Vec<String>>, path:
}
}

#[allow(clippy::unnecessary_wraps)]
fn infer_headers(value: &Value) -> Option<Vec<Vec<String>>> {
let mut headers: Vec<Vec<String>> = Vec::new();

Expand Down Expand Up @@ -146,14 +145,13 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
Err(e) => {
if args.flag_ignore_errors {
continue;
} else {
let human_idx = rowidx + 1; // not zero based
return fail_format!(
r#"Could not parse line {human_idx} as JSON! - {e}
}
let human_idx = rowidx + 1; // not zero based, for readability
return fail_format!(
r#"Could not parse line {human_idx} as JSON! - {e}
Use `--ignore-errors` option to skip malformed input lines.
Use `tojsonl` command to convert _to_ jsonl instead of _from_ jsonl."#,
);
}
);
}
};

Expand Down

0 comments on commit 956791f

Please sign in to comment.