refactor: remove expect for lazy barrel pending forwarded ids#11646
refactor: remove expect for lazy barrel pending forwarded ids#11646
Conversation
✅ Deploy Preview for rspack canceled.
|
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the as_pending_forwarded_ids method in the lazy barrel artifact to avoid the use of expect() by ensuring the state is always set to pending before access.
- Renamed method from
as_pending_forwarded_idstopending_forwarded_idswith cleaner semantics - Modified the method to always return a mutable reference instead of an Option, eliminating the need for
expect() - Added state reset logic to ensure entries with existing lazy dependencies are converted to pending state
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/rspack_core/src/compilation/make/lazy_barrel_artifact.rs | Refactored method to reset state to pending and return mutable reference directly |
| crates/rspack_core/src/compilation/make/graph_updater/repair/add.rs | Updated call site to use new method signature without expect() |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
📦 Binary Size-limit
❌ Size increased by 128bytes from 47.43MB to 47.43MB (⬆️0.00%) |
CodSpeed Performance ReportMerging #11646 will not alter performanceComparing 🎉 Hooray!
|
Summary
Just reset the state to pending here to avoid the
expect()Related links
Checklist