Skip to content

[dropshot_endpoint] support raw identifiers as API trait method names - #1698

Open
sunshowers wants to merge 1 commit into
jj-stack/dropshot-endpoint-reuse-is-wildcard-path-in-endpoint-validation-ysptqworfrom
jj-stack/dropshot-endpoint-support-raw-identifiers-as-api-trait-method-names-oqnqxvqk
Open

[dropshot_endpoint] support raw identifiers as API trait method names#1698
sunshowers wants to merge 1 commit into
jj-stack/dropshot-endpoint-reuse-is-wildcard-path-in-endpoint-validation-ysptqworfrom
jj-stack/dropshot-endpoint-support-raw-identifiers-as-api-trait-method-names-oqnqxvqk

Conversation

@sunshowers

Copy link
Copy Markdown
Collaborator

The api_description macro generates variable names using something like format_ident!("endpoint_{}", name_str). For a method named r#async, that produces endpoint_r#async, which is not a valid identifier. This resulted in format_ident! panicking with "custom attribute panicked".

To avoid this, strip the r# prefix.

The `api_description` macro generates variable names using something like `format_ident!("endpoint_{}", name_str)`. For a method named `r#async`, that produces `endpoint_r#async`, which is not a valid identifier. This resulted in `format_ident!` panicking with "custom attribute panicked".

To avoid this, strip the `r#` prefix.
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