Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary code comment #666

Merged
merged 1 commit into from
Nov 15, 2023

Conversation

tcharding
Copy link
Member

These comments say what the code is doing, they add no value.

Copy link
Collaborator

@Kixunil Kixunil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK e3daddd

for (i, byte) in fake_signature_data.iter_mut().enumerate() {
// up to MAX_LEN
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was meant as justification why as is OK. :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I didn't read it as such, my bad. I can re-work this and improve instead of remove the comment.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both options sound fine to me.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be on the same line as the as so that it's visible with grep.

rustfmt might fuck it up; see the most recent rustfmt fight in which inline comments were described as "weird" and "C like". But hopefully not.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, that's at least uncommon. And you can give grep context. Although I do think it'd be nice if Rust folks were more welcoming towards people who need to document their code this way. ;)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It stays on the line.

"what" comments add no value. Remove one and make the other describe
"why" the cast is ok.
Copy link
Collaborator

@Kixunil Kixunil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 4587122

Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 4587122

@apoelstra apoelstra merged commit 4244fec into rust-bitcoin:master Nov 15, 2023
20 checks passed
@tcharding tcharding deleted the 11-14-remove-code-comments branch December 6, 2023 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants