async-graphql/derive/src
Aaron Hill cea22da228
Strip r# prefix when constructing getter ident
When calling `to_string()` on an identifier, the returned string will
have an `r#` prefix if the original identifer was a raw identifier. This
prefix needs to be removed if the identifier is interpolated into
another identifier (e.g. `__some_prefix__r#other_ident`) in order for
the new identifier to be valid.

This issue was previously masked due to the fact that the relevant test
uses `r#i32`. It's possible to use `i32` as a normal (non-raw) ident -
due to a bug in rustc, this means that the user-supplied `r#` prefix
will be lost when calling `to_string()`. This bug will eventually be
fixed, causing `to_string()` to start returning `r#i32` instead of
`i32`.

This commit strips the `r#` prefix (if present) from an identifier
before using it to construct a new identifier. The relevant test is
updated to use `r#match`, which actually requires the `r#` prefix to be
a valid identifier. This causes the test to fail without this patch on
current versions of Rust.
2020-12-20 19:08:22 -05:00
..
args.rs Add custom complexity for subscription. 2020-12-19 18:39:33 +08:00
description.rs Add custom complexity for subscription. 2020-12-19 18:39:33 +08:00
enum.rs Add visible attributes on types, fields, and parameters, allowing some content to be hidden based on conditions. 2020-12-12 16:23:53 +08:00
input_object.rs Add the skip attribute to the InputObject fields. 2020-12-15 20:29:59 +08:00
interface.rs Add custom complexity for subscription. 2020-12-19 18:39:33 +08:00
lib.rs Add use_type_description attribute for derive macros Object, Scalar and Subscription. 2020-10-26 21:34:05 +08:00
merged_object.rs Add visible attributes on types, fields, and parameters, allowing some content to be hidden based on conditions. 2020-12-12 16:23:53 +08:00
merged_subscription.rs Add visible attributes on types, fields, and parameters, allowing some content to be hidden based on conditions. 2020-12-12 16:23:53 +08:00
object.rs Strip r# prefix when constructing getter ident 2020-12-20 19:08:22 -05:00
output_type.rs 2.0.1 2020-10-14 10:25:41 +08:00
scalar.rs Add visible attributes on types, fields, and parameters, allowing some content to be hidden based on conditions. 2020-12-12 16:23:53 +08:00
simple_object.rs Improve depth and complex. 2020-12-18 18:56:28 +08:00
subscription.rs Add custom complexity for subscription. 2020-12-19 18:39:33 +08:00
union.rs Add visible attributes on types, fields, and parameters, allowing some content to be hidden based on conditions. 2020-12-12 16:23:53 +08:00
utils.rs Add custom complexity for subscription. 2020-12-19 18:39:33 +08:00