Skip to content

More chain code refactoring - #7118

Open
matthewhughes934 wants to merge 3 commits into
rust-lang:mainfrom
matthewhughes934:chain-refactor-3
Open

More chain code refactoring#7118
matthewhughes934 wants to merge 3 commits into
rust-lang:mainfrom
matthewhughes934:chain-refactor-3

Conversation

@matthewhughes934

@matthewhughes934 matthewhughes934 commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

I'm continuing to try and make this code more understandable as I walk
through it. All the changes here should be pure refactoring, so not
behavioural changes.

  • refactor(chain): refactor chain parsing

    Some general code cleanup, things like:

    • Replace some ref patterns with & ones
    • Only pass down only required field to helper function
    • Add comments for span attribute
  • refactor(chain): drop CommentPosition

    I found the naming in this type quite confusing: all it was tracking was
    "does this comment belong on the same line", so use a bool for this
    purpose.

  • Add some more chain comment tests

    So that I can be confidence that my future refactors aren't changing
    some untested behaviour.

  • I did not use an LLM to create a change in this PR.

  • I used an LLM to create a change in this PR, and I have explained below how it was used.

Some general code cleanup, things like:

* Replace some `ref` patterns with `&` ones
* Only pass down only required field to helper function
* Add comments for span attribute
I found the naming in this type quite confusing: all it was tracking was
"does this comment belong on the same line", so use a bool for this
purpose.
@rustbot rustbot added the S-waiting-on-review Status: awaiting review from the assignee but also interested parties. label Sep 12, 2026
So that I can be confidence that my future refactors aren't changing
some untested behaviour.
@jieyouxu jieyouxu self-assigned this Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants