Skip to content

refactor: inline single-use parse_bucket_name#158

Open
alukach wants to merge 1 commit into
mainfrom
refactor/inline-parse-bucket-name
Open

refactor: inline single-use parse_bucket_name#158
alukach wants to merge 1 commit into
mainfrom
refactor/inline-parse-bucket-name

Conversation

@alukach

@alukach alukach commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

What

parse_bucket_name was a one-line split_once wrapper called from a single place (get_bucket). Inline it.

let (account, product) = name
    .split_once(crate::BUCKET_SEPARATOR)
    .ok_or_else(|| ProxyError::BucketNotFound(name.to_string()))?;

Why

A named helper that wraps a single stdlib call and has one caller is indirection without payoff. The call site is just as clear with split_once inline.

Verification

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

Found via ponytail over-engineering audit.

🤖 Generated with Claude Code

parse_bucket_name was a one-line split_once wrapper with one caller.
Inline it at the get_bucket call site.

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 32s —— View job


✅ No blocking issues — safe to merge.

The inlining is mechanically correct — behavior is identical to the removed helper. One minor observation:

  • src/registry.rs:53: The comment hardcodes "account:product" rather than referencing crate::BUCKET_SEPARATOR. If the constant ever changes, the comment will silently lie. Not blocking, but replacing the literal with BUCKET_SEPARATOR's actual value from the constant (or just removing the format hint and leaving only the pre-mapped note) would be more durable.

@github-actions

Copy link
Copy Markdown

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

  • Date: 2026-06-18T23:36:44Z
  • Commit: 1919dbc

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