Skip to content

(refactor): take syntactic_kind by &str and inline format args in write_function_signature - #10320

Merged
orizi merged 1 commit into
mainfrom
orizi/08-05-_refactor_take_syntactic_kind_by_str_and_inline_format_args_in_write_function_signature
Aug 5, 2026
Merged

(refactor): take syntactic_kind by &str and inline format args in write_function_signature#10320
orizi merged 1 commit into
mainfrom
orizi/08-05-_refactor_take_syntactic_kind_by_str_and_inline_format_args_in_write_function_signature

Conversation

@orizi

@orizi orizi commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Two small cleanups in write_function_signature, split out of #10271 where
they were flagged as correct but out of scope:

  • syntactic_kind is only ever read by value into a format string, and all
    four call sites pass a literal, so take it as &str and drop the
    .to_string() at each call site.
  • Inline syntactic_kind and resolver_generic_params into the format
    string, per the repo convention of inlining variable names where possible.
    Visibility and name stay positional since they are call expressions.

No behavior change; no golden updates. cargo test -p cairo-lang-doc passes
with no golden diffs; rust_fmt.sh and clippy.sh are clean.

🤖 Generated with Claude Code

…te_function_signature

Two small cleanups in `write_function_signature`, split out of #10271 where
they were flagged as correct but out of scope:

- `syntactic_kind` is only ever read by value into a format string, and all
  four call sites pass a literal, so take it as `&str` and drop the
  `.to_string()` at each call site.
- Inline `syntactic_kind` and `resolver_generic_params` into the format
  string, per the repo convention of inlining variable names where possible.
  Visibility and name stay positional since they are call expressions.

No behavior change; no golden updates.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@cursor

cursor Bot commented Aug 5, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Documentation formatting-only refactor with no intended behavior change.

Overview
Refactors write_function_signature in the doc formatter so the optional prefix ("" or "extern ") is passed as &str instead of String, removing .to_string() at the four call sites (free, trait, impl, and extern functions).

The opening write! now inlines syntactic_kind and resolver_generic_params in the format string (named placeholders); visibility and the function name stay as separate positional arguments. No change to generated documentation signatures.

Reviewed by Cursor Bugbot for commit ea5908b. Bugbot is set up for automated code reviews on this repo. Configure here.

orizi commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author

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

@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

@TomerStarkware TomerStarkware left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

:lgtm:

@TomerStarkware reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on eytan-starkware).

@orizi
orizi added this pull request to the merge queue Aug 5, 2026
Merged via the queue into main with commit 4860036 Aug 5, 2026
55 checks passed
@orizi
orizi deleted the orizi/08-05-_refactor_take_syntactic_kind_by_str_and_inline_format_args_in_write_function_signature branch August 5, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants