Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions crates/oxc_linter/src/fixer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ impl<'c, 'a: 'c> RuleFixer<'c, 'a> {
self
}

// NOTE(@DonIsaac): Internal methods shouldn't use `T: Into<Foo>` generics to optimize binary
// size. Only use such generics in public APIs.
fn new_fix(&self, fix: CompositeFix, message: Option<Cow<'static, str>>) -> RuleFix {
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

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

[nitpick] This comment appears to still be relevant and describes an important architectural pattern used in this file. The pattern is actively followed:

  • Public methods like replace (line 110) and insert_text_before (line 131) use Into<Cow<'static, str>> generics
  • These public methods call inner functions (e.g., line 112-126) to "avoid megamorphic bloat"
  • Internal/private methods like new_fix (line 55) and insert_text_at (line 170) take concrete types without Into<T> generics

This comment documents why this pattern exists and could help future maintainers understand the architectural decision. Consider keeping it or moving it to a more prominent location if the placement above new_fix is no longer appropriate.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

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

Ah maybe you're right. I don't know. Closing.

RuleFix::new(self.kind, message, fix)
}
Expand Down
Loading