Skip to content

feat(common): add EnumString and IntoStaticStr derives to BasinScope#344

Merged
shikhar merged 1 commit intomainfrom
shikhar/basin-scope-strum-derives
Mar 22, 2026
Merged

feat(common): add EnumString and IntoStaticStr derives to BasinScope#344
shikhar merged 1 commit intomainfrom
shikhar/basin-scope-strum-derives

Conversation

@shikhar
Copy link
Copy Markdown
Member

@shikhar shikhar commented Mar 22, 2026

Summary

  • Add strum::EnumString and strum::IntoStaticStr derives to BasinScope enum, enabling string parsing and static str conversion.

Test plan

  • just test passes

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 22, 2026

Greptile Summary

This PR adds strum::EnumString and strum::IntoStaticStr derives to the BasinScope enum in common/src/types/basin.rs, enabling string-to-enum parsing via FromStr (e.g. "aws:us-east-1".parse::<BasinScope>()) and enum-to-&'static str conversion.

  • The strum crate with features = ["derive"] is already a workspace dependency, so no new dependencies are introduced.
  • The existing #[strum(serialize = "aws:us-east-1")] attribute already drives the new derives correctly — all three (Display, EnumString, IntoStaticStr) will use the same canonical string "aws:us-east-1", ensuring consistency.
  • No existing FromStr implementation exists for BasinScope, so there is no conflict from EnumString.
  • The change is minimal and self-contained.

Confidence Score: 5/5

  • Safe to merge — purely additive derive macros with no breaking changes.
  • The change is three lines, purely additive (new trait impls via derives), consistent with the existing strum usage on the same enum, and relies on a dependency already in the workspace. No conflicts, no logic changes, no risk surface.
  • No files require special attention.

Important Files Changed

Filename Overview
common/src/types/basin.rs Adds strum::EnumString and strum::IntoStaticStr derives to BasinScope; no conflicts with existing impls, strum dependency already present with derive feature, and the #[strum(serialize = "aws:us-east-1")] attribute already in place correctly drives all three derives.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["str input: aws:us-east-1"]
    B["BasinScope::AwsUsEast1"]
    C["String via Display"]
    D["static str via IntoStaticStr"]

    A -->|"EnumString / FromStr - NEW"| B
    B -->|"Display existing"| C
    B -->|"IntoStaticStr - NEW"| D
Loading

Reviews (1): Last reviewed commit: "feat(common): add EnumString and IntoSta..." | Re-trigger Greptile

@shikhar shikhar merged commit cf52624 into main Mar 22, 2026
17 checks passed
@shikhar shikhar deleted the shikhar/basin-scope-strum-derives branch March 22, 2026 13:51
@s2-release-plz s2-release-plz bot mentioned this pull request Mar 22, 2026
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.

1 participant