Skip to content

refactor: remove expect for lazy barrel pending forwarded ids#11646

Merged
ahabhgk merged 1 commit intomainfrom
fix-remove-options-pending-forwarded-ids
Sep 11, 2025
Merged

refactor: remove expect for lazy barrel pending forwarded ids#11646
ahabhgk merged 1 commit intomainfrom
fix-remove-options-pending-forwarded-ids

Conversation

@ahabhgk
Copy link
Contributor

@ahabhgk ahabhgk commented Sep 11, 2025

Summary

Just reset the state to pending here to avoid the expect()

Related links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings September 11, 2025 11:02
@github-actions github-actions bot added team The issue/pr is created by the member of Rspack. release: refactor labels Sep 11, 2025
@ahabhgk ahabhgk enabled auto-merge (squash) September 11, 2025 11:03
@netlify
Copy link

netlify bot commented Sep 11, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 34030af
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/68c2ac66f02cbb000818b6d9

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_ids to pending_forwarded_ids with 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.

@github-actions
Copy link
Contributor

📦 Binary Size-limit

Comparing 34030af to chore(ci): add fallback value for scheduled workflow run (#11641) by pshu

❌ Size increased by 128bytes from 47.43MB to 47.43MB (⬆️0.00%)

@codspeed-hq
Copy link

codspeed-hq bot commented Sep 11, 2025

CodSpeed Performance Report

Merging #11646 will not alter performance

Comparing fix-remove-options-pending-forwarded-ids (34030af) with main (41cf73d)

🎉 Hooray! codspeed-rust just leveled up to 2.7.2!

A heads-up, this is a breaking change and it might affect your current performance baseline a bit. But here's the exciting part - it's packed with new, cool features and promises improved result stability 🥳!
Curious about what's new? Visit our releases page to delve into all the awesome details about this new version.

Summary

✅ 17 untouched

@ahabhgk ahabhgk merged commit 293975c into main Sep 11, 2025
47 checks passed
@ahabhgk ahabhgk deleted the fix-remove-options-pending-forwarded-ids branch September 11, 2025 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: refactor team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants