refactor: GeyserPluginManager doesn't need to implement an empty new() when it derives Default#7750
Conversation
|
@bw-solana: github didn't recommend any reviewers. Could you maybe recommend someone or review please? |
Added @lijunwangs |
| warp_slot: Default::default(), | ||
| accounts: Default::default(), | ||
| upgradeable_programs: Default::default(), | ||
| ticks_per_slot: Default::default(), |
There was a problem hiding this comment.
Clippy is not happy with this change. To me, I am not sure I like all Default::default either, It is harder to read without actually looking up the data type.
There was a problem hiding this comment.
@lijunwangs: thanks for the review. I didn't realise we had such lints enabled.
I can fix it up to what clippy suggests. Would that be acceptable or do you prefer the code as is?
There was a problem hiding this comment.
I think we can just make the geyser trivial new --> default change and leaving the rest alone. Code clarity is more important.
There was a problem hiding this comment.
OK, I reverted these changes. PTAL.
Default::default() are usedGeyserPluginManager doesn't need to implement an empty new() when it derives Default
lijunwangs
left a comment
There was a problem hiding this comment.
175 | geyser_plugin_manager: Arc::new(RwLock::new(GeyserPluginManager::new())),
still some test code using the removed ::new
ah, when I undid the default changes, this crept back in. Should be fixed now. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #7750 +/- ##
=========================================
- Coverage 83.0% 83.0% -0.1%
=========================================
Files 812 812
Lines 357199 357194 -5
=========================================
- Hits 296801 296732 -69
- Misses 60398 60462 +64 🚀 New features to boost your workflow:
|
Problem
GeyserPluginManagerderives default and implementsnew()with takes no arguments and effectively callsdefault().Summary of Changes
GeyserPluginManager::new()