Skip to content

refactor: module diagnostic action move to Diagnosable trait#9264

Merged
jerrykingxyz merged 2 commits intomainfrom
jerry/diag
Feb 12, 2025
Merged

refactor: module diagnostic action move to Diagnosable trait#9264
jerrykingxyz merged 2 commits intomainfrom
jerry/diag

Conversation

@jerrykingxyz
Copy link
Copy Markdown
Contributor

@jerrykingxyz jerrykingxyz commented Feb 12, 2025

Summary

  1. use &mut self for add_* method in Diagnosable trait, and remove useless method
trait Diagnosable {
-  fn add_diagnostic(&self, _diagnostic: Diagnostic);
+ fn add_diagnostic(&mut self, _diagnostic: Diagnostic);
-  fn add_diagnostics(&self, _diagnostics: Vec<Diagnostic>);
+ fn add_diagnostics(&mut self, _diagnostics: Vec<Diagnostic>);

-  fn clone_diagnostics(&self) -> Vec<Diagnostic>;
-  fn take_diagnostics(&self) -> Vec<Diagnostic>;
-  fn pipe_diagnostics(&self, target: &dyn Diagnosable);
}
  1. move diagnostics action from Module trait to Diagnosable trait
trait Module {
-  fn get_diagnostics(&self) -> Vec<Diagnostic>;
}
trait Diagnosable {
+  fn diagnostics(&self) -> Cow<[Diagnostic]>;
}

Checklist

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

@jerrykingxyz jerrykingxyz changed the title refactor: module diagnostic action move toDiagnosable trait refactor: module diagnostic action move to Diagnosable trait Feb 12, 2025
@netlify
Copy link
Copy Markdown

netlify bot commented Feb 12, 2025

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit 80388a5
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/67ac63105e329f00085c05d3
😎 Deploy Preview https://deploy-preview-9264--rspack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label Feb 12, 2025
@jerrykingxyz jerrykingxyz enabled auto-merge (squash) February 12, 2025 09:11
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Feb 12, 2025

CodSpeed Performance Report

Merging #9264 will not alter performance

Comparing jerry/diag (80388a5) with main (8b066ad)

🎉 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

✅ 6 untouched benchmarks

@jerrykingxyz jerrykingxyz merged commit 7fca533 into main Feb 12, 2025
41 checks passed
@jerrykingxyz jerrykingxyz deleted the jerry/diag branch February 12, 2025 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants