Skip to content

Commit a9facf0

Browse files
committed
style(man): fix minor code style issues
Remove unnecessary deref in string comparison and use descriptive name for `example_command` variable in `render_examples_section`. https://claude.ai/code/session_01CrXuWDMVQsiUBoy6ceACsF
1 parent 8ac426b commit a9facf0

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

cli/man_page.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ fn render_man_output(page_num: u8) -> Result<String, String> {
7878

7979
fn check_file(path: &str, expected: &str) -> ExitCode {
8080
match std::fs::read_to_string(path) {
81-
Ok(actual) if actual == *expected => ExitCode::SUCCESS,
81+
Ok(actual) if actual == expected => ExitCode::SUCCESS,
8282
Ok(_) => {
8383
eprintln!("{path} is outdated, run ./generate-completions.sh to update it");
8484
ExitCode::FAILURE

src/man_page.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,8 @@ fn render_examples_section(out: &mut String, command: &Command) {
271271
if line.is_empty() {
272272
continue;
273273
}
274-
if let Some(command) = line.strip_prefix("$ ") {
275-
writeln!(out, ".nf\n\\fB$ {}\\fR\n.fi", roff_escape(command)).unwrap();
274+
if let Some(example_command) = line.strip_prefix("$ ") {
275+
writeln!(out, ".nf\n\\fB$ {}\\fR\n.fi", roff_escape(example_command)).unwrap();
276276
} else {
277277
writeln!(out, ".TP\n{}", roff_escape(line)).unwrap();
278278
}

0 commit comments

Comments
 (0)