Skip to content

refactor: inline single-use is_write_method#157

Open
alukach wants to merge 1 commit into
mainfrom
refactor/inline-is-write-method
Open

refactor: inline single-use is_write_method#157
alukach wants to merge 1 commit into
mainfrom
refactor/inline-is-write-method

Conversation

@alukach

@alukach alukach commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

What

is_write_method was a six-line matches! wrapper with exactly one caller. Inline it into the write-method short-circuit and delete the function.

if !is_special_path
    && matches!(
        parts.method,
        http::Method::PUT | http::Method::POST | http::Method::DELETE | http::Method::PATCH
    )
{

Why

One abstraction, one call site — the helper added a name but no reuse. The inlined matches! reads the same and removes the indirection.

Verification

Full pre-push suite (fmt, clippy wasm32, wasm check, tests) green.

Found via ponytail over-engineering audit.

🤖 Generated with Claude Code

The is_write_method helper had exactly one caller. Inline the matches!
into the write-method short-circuit and drop the function.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@claude

claude Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Claude finished @alukach's task in 21s —— View job


✅ No blocking issues — safe to merge.

  • The dereference *method in the removed helper (which accepted &http::Method) is correctly dropped in the inlined form: parts.method is the owned value, so no deref is needed and matches! ergonomics handle it cleanly.
  • Semantic equivalence is preserved — same four methods, same short-circuit position, same result.

@github-actions

Copy link
Copy Markdown

🚀 Latest commit deployed to https://source-data-proxy-pr-157.source-coop.workers.dev

  • Date: 2026-06-18T23:35:55Z
  • Commit: b27fe62

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant