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

Fix clippy lints #6310

Closed
wants to merge 2 commits into from
Closed

Conversation

mkrasnitski
Copy link
Contributor

@mkrasnitski mkrasnitski commented Jan 12, 2025

Ran cargo clippy with default lints. A few small cleanups included as well.

Copy link
Member

Choose a reason for hiding this comment

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

I find the before to be more readable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, it would be best if the definition of BNInstructionInfo was the following instead:

pub struct BNInstructionInfo {
    pub length: usize,
    pub branchCount: usize,
    pub archTransitionByTargetAddr: bool,
    pub delaySlots: u8,
    pub branchInfo: [BNBranchInfo; 3usize],
}

pub struct BNBranchInfo {
    pub branchType: BNBranchType,
    pub branchTarget: u64,
    #[doc = " If null, same architecture as instruction"]
    pub branchArch: *mut BNArchitecture,
}

Then we could iterate over all the branch info at once instead of by-index. This would require changing the C++ definition though.

rust/build.rs Show resolved Hide resolved
@emesare
Copy link
Member

emesare commented Jan 13, 2025

Merged with 3ea9c4e thank you! I also went ahead and added clippy to the CI, it should only warn however. Mostly just good for visibility in PR's!

@emesare emesare closed this Jan 13, 2025
@mkrasnitski mkrasnitski deleted the clippy branch January 20, 2025 01:00
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.

2 participants