From 59142b3126556304e3d5da3cf88a13bf41dff211 Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Sat, 21 Jan 2023 08:07:13 -0500 Subject: [PATCH] `safenames` & `sortcheck`: add comments about safe unwraps [skip ci] --- src/cmd/safenames.rs | 1 + src/cmd/sortcheck.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/cmd/safenames.rs b/src/cmd/safenames.rs index dcdca9844..e6fd2f2f0 100644 --- a/src/cmd/safenames.rs +++ b/src/cmd/safenames.rs @@ -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!( "{}", diff --git a/src/cmd/sortcheck.rs b/src/cmd/sortcheck.rs index 6d47b5415..12b981548 100644 --- a/src/cmd/sortcheck.rs +++ b/src/cmd/sortcheck.rs @@ -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!( "{}",