intcmp(1): rewrite in Rust #144

Closed
trinity wants to merge 0 commits from intcmp into main
Owner
No description provided.
trinity added the
enhancement
label 2024-07-15 09:16:17 +00:00
trinity added 2 commits 2024-07-15 09:16:18 +00:00
trinity requested review from emma 2024-07-15 09:16:27 +00:00
emma requested changes 2024-07-15 20:00:47 +00:00
Dismissed
src/intcmp.rs Outdated
@ -0,0 +34,4 @@
fn main() -> ExitCode {
let argv = args().collect::<Vec<String>>();
let mut can_eq = false;
Owner

These variable names can be the flags with a comment:

let mut e = false; /* integers can be equal */
These variable names can be the flags with a comment: ```rs let mut e = false; /* integers can be equal */ ```
trinity marked this conversation as resolved
src/intcmp.rs Outdated
@ -0,0 +51,4 @@
optind = opt.ind();
}
if argv.len() - optind < 2 /* ref cmp */ { return usage(&argv[0]); }
Owner

This comment needs to be more descriptive. What does ref cmp mean? Refer to comparison? Reflect comparison? Refine complexity?

This comment needs to be more descriptive. What does `ref cmp` mean? Refer to comparison? Reflect comparison? Refine complexity?
trinity marked this conversation as resolved
src/intcmp.rs Outdated
@ -0,0 +53,4 @@
if argv.len() - optind < 2 /* ref cmp */ { return usage(&argv[0]); }
let mut reference: Option<usize> = None;
Owner

This either needs to be commented or needs to have a more descriptive variable name. This is not a reference as far as I’m aware so I’m kind of confused why this is called that.

This either needs to be commented or needs to have a more descriptive variable name. This is not a reference as far as I’m aware so I’m kind of confused why this is called that.
trinity marked this conversation as resolved
src/intcmp.rs Outdated
@ -0,0 +65,4 @@
}
}
if let Some(refn) = reference {
Owner

This block needs to be commented to explain what’s going on.

This block needs to be commented to explain what’s going on.
trinity marked this conversation as resolved
trinity added 1 commit 2024-07-15 20:52:36 +00:00
trinity requested review from emma 2024-07-15 20:53:00 +00:00
emma approved these changes 2024-07-15 21:04:40 +00:00
Author
Owner

Merged.

Merged.
trinity closed this pull request 2024-07-15 21:22:26 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: bonsai/harakit#144
No description provided.