Skip to content

House keeping: Fix all clippy warnings#463

Merged
DZakh merged 3 commits into
mainfrom
jp/clippy-fixes
Mar 4, 2025
Merged

House keeping: Fix all clippy warnings#463
DZakh merged 3 commits into
mainfrom
jp/clippy-fixes

Conversation

@JonoPrest

@JonoPrest JonoPrest commented Mar 4, 2025

Copy link
Copy Markdown
Collaborator

Ran the clippy linter for the codegen code and fixed all its warnings.

@JonoPrest JonoPrest requested a review from DZakh March 4, 2025 10:40

@DZakh DZakh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Wow, this is impressive 🔥

pub enum Abi {
Evm(EvmAbi),
Fuel(FuelAbi),
Fuel(Box<FuelAbi>),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I never used Box. What is it needed for?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It's a clippy warning suggestion.

Box is like a c pointer. So it's an address on the heap. The reason to use it here is that the FuelAbi type is very big in memory. So the enum has to allocate all that memory even in the evm case. Clippy suggests using a pointer here instead to be more efficient

@DZakh DZakh enabled auto-merge (squash) March 4, 2025 11:44
@DZakh DZakh merged commit 2e52973 into main Mar 4, 2025
@DZakh DZakh deleted the jp/clippy-fixes branch March 4, 2025 11:53
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