wormhole-foundation / native-token-transfers

Open, flexible, and composable framework for transferring tokens across blockchains without liquidity pools
Other
22 stars 40 forks source link

solana: Add or_fun_call clippy lint for efficiency gains #452

Closed johnsaigle closed 3 months ago

johnsaigle commented 5 months ago

Using the or_fun_call lint will help maintainers to write functions that allow the program to evaluate lazily in the happy path. This should boost efficiency!

To enable the lint to run without warnings, I fixed one existing violation. Braces are added around the called to Pubkey::default(); otherwise, I ran into a clippy warning about a redundant closure. Let me know if there's an issue here.