Skip to content

Commit

Permalink
safenames & sortcheck: add comments about safe unwraps
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
jqnatividad committed Jan 21, 2023
1 parent f371ac2 commit 59142b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/cmd/safenames.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
unsafe_headers: unsafenames_vec,
safe_headers: safenames_vec,
};
// its OK to have unwrap here because safenames_struct is always valid
if safenames_mode == SafeNameMode::VerifyVerbosePrettyJSON {
println!(
"{}",
Expand Down
1 change: 1 addition & 0 deletions src/cmd/sortcheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
unsorted_breaks,
dupe_count,
};
// it's OK to have unwrap here as we know sortcheck_struct is valid json
if args.flag_pretty_json {
println!(
"{}",
Expand Down

0 comments on commit 59142b3

Please sign in to comment.