Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(general): Introduce macros for traversing Annotated #826

Merged
merged 2 commits into from
Feb 26, 2021

Conversation

jan-auer
Copy link
Member

@jan-auer jan-auer commented Oct 30, 2020

This is WIP to experiment with the API for an Annotated traversal macro.

This ended up as a macro since code generation is required for accessing fields and inferring the types. There are two macros:

  • get_path!(foo.bar.baz) gets the Annotated at the path.
  • get_value!(foo.bar.baz) gets the inner value at the path.

Both return an Option. There is an alternate form for both get_{path,value}!(foo.bar.baz!) that unwraps the path.

#skip-changelog

@jan-auer jan-auer self-assigned this Oct 30, 2020
@jan-auer
Copy link
Member Author

@untitaker what do you think about this macro? If you like, I can wrap this up and update most tests, as well as migrate them over to insta.

@untitaker
Copy link
Member

it's good, let's merge

@untitaker
Copy link
Member

@jan-auer are you still interested in pursuing this? I think it would be useful.

* master: (120 commits)
  fix(protocol): Deny backslashes in release names (#904)
  ref(server): Extract dynamic sampling functionality into own crate (#940)
  build: Switch to vendored openssl build (#914)
  feat(server): Add inbound filters functionality to dynamic sampling (#920)
  fix rule generation to new format (in tests) (#939)
  ref: Remove actix-web client, make reqwest the new http client (#938)
  fix(server): Reject empty envelopes with an explicit error (#937)
  fix(server): Ensure outcome data categories are numeric (#936)
  feat(stats): Add data category to TrackOutcome (#931)
  fix(pii): Make username pii-strippable (#935)
  build: Bump symbolic to 8.0.4 (#899)
  fix: Update to tokio 1.0 (#909)
  fix(pii): Make and/or work correctly with pii=maybe (#932)
  release: 21.2.0
  release: 0.8.3
  fix(build): Fix path to 3.7 (#930)
  build: drop python 2.7 support (#929)
  feat(protocol): Add snapshot to the stack trace interface (#927)
  test: Improve integration tests to reduce flakyness (#928)
  fix: Ignore false-positive lints from Clippy 1.50 (#926)
  ...
@jan-auer jan-auer marked this pull request as ready for review February 26, 2021 12:03
@jan-auer jan-auer requested a review from a team February 26, 2021 12:03
@jan-auer jan-auer enabled auto-merge (squash) February 26, 2021 12:14
@jan-auer jan-auer merged commit 2e043f9 into master Feb 26, 2021
@jan-auer jan-auer deleted the ref/get-value-macro branch February 26, 2021 12:32
jan-auer added a commit that referenced this pull request Feb 26, 2021
* master:
  test(general): Introduce macros for traversing Annotated (#826)
  fix(protocol): Deny backslashes in release names (#904)
  ref(server): Extract dynamic sampling functionality into own crate (#940)
  build: Switch to vendored openssl build (#914)
  feat(server): Add inbound filters functionality to dynamic sampling (#920)
  fix rule generation to new format (in tests) (#939)
  ref: Remove actix-web client, make reqwest the new http client (#938)
  fix(server): Reject empty envelopes with an explicit error (#937)
  fix(server): Ensure outcome data categories are numeric (#936)
  feat(stats): Add data category to TrackOutcome (#931)
  fix(pii): Make username pii-strippable (#935)
  build: Bump symbolic to 8.0.4 (#899)
  fix: Update to tokio 1.0 (#909)
  fix(pii): Make and/or work correctly with pii=maybe (#932)
  release: 21.2.0
  release: 0.8.3
  fix(build): Fix path to 3.7 (#930)
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.

2 participants