Skip to content

Comments

refactor(linter): remove outdated comment#16430

Closed
overlookmotel wants to merge 1 commit into11-30-perf_linter_plugins_reduce_calls_to_path_to_string_lossy_from
11-30-refactor_linter_remove_outdated_comment
Closed

refactor(linter): remove outdated comment#16430
overlookmotel wants to merge 1 commit into11-30-perf_linter_plugins_reduce_calls_to_path_to_string_lossy_from
11-30-refactor_linter_remove_outdated_comment

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Dec 3, 2025

Pure refactor. Remove a comment which is no longer relevant.

@github-actions github-actions bot added the A-linter Area - Linter label Dec 3, 2025
Copy link
Member Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added the C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior label Dec 3, 2025
@overlookmotel overlookmotel marked this pull request as ready for review December 3, 2025 08:52
Copilot AI review requested due to automatic review settings December 3, 2025 08:52
@overlookmotel overlookmotel self-assigned this Dec 3, 2025
@overlookmotel
Copy link
Member Author

Tiny change to docs only, so merging without review.

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 3, 2025

CodSpeed Performance Report

Merging #16430 will not alter performance

Comparing 11-30-refactor_linter_remove_outdated_comment (d193781) with main (ee0756b)1

Summary

✅ 4 untouched
⏩ 41 skipped2

Footnotes

  1. No successful run was found on 11-30-perf_linter_plugins_reduce_calls_to_path_to_string_lossy_ (d97035b) during the generation of this report, so main (ee0756b) was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

  2. 41 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

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 removes a comment that documents an architectural pattern for optimizing binary size in the linter's fixer module. The comment described avoiding T: Into<Foo> generics in internal methods while using them in public APIs.

Key Changes

  • Removed a comment explaining why internal methods should avoid generic Into<T> parameters for binary size optimization

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


// 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.

@overlookmotel overlookmotel deleted the 11-30-refactor_linter_remove_outdated_comment branch December 3, 2025 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant