Skip to content

chore: Implement FromStr and Into<String> for CrateName#2061

Merged
jfecher merged 1 commit intomasterfrom
phated/cratename-fromstr
Jul 26, 2023
Merged

chore: Implement FromStr and Into<String> for CrateName#2061
jfecher merged 1 commit intomasterfrom
phated/cratename-fromstr

Conversation

@phated
Copy link
Contributor

@phated phated commented Jul 26, 2023

Description

Problem*

Resolves #2060

Summary*

This implements proper traits for CrateName instead of relying on an ad-hoc API. Implementing FromStr allows us to use .parse() on a &str to get a CrateName, and it allows us to use CrateName as a type with clap derivers (or any other APIs that use .parse().

This work fell out of #1992 but should be merged as a prerequisite.

Documentation

  • This PR requires documentation updates when merged.

    • I will submit a noir-lang/docs PR.
    • I will request for and support Dev Rel's help in documenting this PR.

Additional Context

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@phated phated requested review from TomAFrench and kobyhallx July 26, 2023 18:56
@jfecher jfecher enabled auto-merge July 26, 2023 19:10
@jfecher jfecher added this pull request to the merge queue Jul 26, 2023
Merged via the queue into master with commit eec5007 Jul 26, 2023
@jfecher jfecher deleted the phated/cratename-fromstr branch July 26, 2023 19:30
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.

CrateName should implement FromStr

2 participants