fix(templated_uri): re-export data_privacy traits#476
Open
martintmk wants to merge 1 commit into
Open
Conversation
Macro-generated code now references RedactedDisplay and Redactor via the templated_uri re-export instead of data_privacy directly, so downstream crates using the templated macro no longer need a direct data_privacy dependency. This mirrors the existing http re-export.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts templated_uri’s public surface to re-export the data_privacy traits that the templated proc-macro expansion relies on, so downstream crates using #[templated] don’t need to depend on data_privacy directly (mirroring the existing http re-export pattern).
Changes:
- Re-export
data_privacy::{RedactedDisplay, Redactor}fromtemplated_uri(doc-hidden) for macro-generated code. - Update macro implementation to reference
::templated_uri::{RedactedDisplay, Redactor}rather than::data_privacy::{...}. - Refresh macro expansion snapshots and align documentation imports accordingly.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/templated_uri/src/lib.rs | Re-exports RedactedDisplay/Redactor (doc-hidden) to support macro-generated code without downstream data_privacy deps. |
| crates/templated_uri/src/_documentation/recipes.rs | Drops direct import of RedactedDisplay from data_privacy in the docs module context. |
| crates/templated_uri_macros_impl/src/struct_template.rs | Updates generated impls/UFCS calls to use ::templated_uri::{RedactedDisplay, Redactor}. |
| crates/templated_uri_macros_impl/src/enum_template.rs | Updates generated impls to use ::templated_uri::{RedactedDisplay, Redactor}. |
| crates/templated_uri_macros_impl/src/snapshots/templated_uri_macros_impl__tests__templated_uri_impl.snap | Snapshot update reflecting new ::templated_uri trait paths. |
| crates/templated_uri_macros_impl/src/snapshots/templated_uri_macros_impl__tests__templated_unredacted_uri_impl.snap | Snapshot update reflecting new ::templated_uri trait paths. |
| crates/templated_uri_macros_impl/src/snapshots/templated_uri_macros_impl__tests__template_enum_impl.snap | Snapshot update reflecting new ::templated_uri trait paths. |
| crates/templated_uri_macros_impl/src/snapshots/templated_uri_macros_impl__tests__query_param_is_kv_expansion.snap | Snapshot update reflecting new ::templated_uri trait paths. |
| crates/templated_uri_macros_impl/src/snapshots/templated_uri_macros_impl__tests__optional_reference_field_codegen.snap | Snapshot update reflecting new ::templated_uri trait paths. |
| crates/templated_uri_macros_impl/src/snapshots/templated_uri_macros_impl__tests__optional_field_with_unredacted_codegen.snap | Snapshot update reflecting new ::templated_uri trait paths. |
| crates/templated_uri_macros_impl/src/snapshots/templated_uri_macros_impl__tests__optional_field_codegen.snap | Snapshot update reflecting new ::templated_uri trait paths. |
| crates/templated_uri_macros_impl/src/snapshots/templated_uri_macros_impl__tests__field_level_unredacted.snap | Snapshot update reflecting new ::templated_uri trait paths. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #476 +/- ##
=======================================
Coverage 100.0% 100.0%
=======================================
Files 319 319
Lines 24676 24676
=======================================
Hits 24676 24676 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Macro-generated code now references RedactedDisplay and Redactor via the templated_uri re-export instead of data_privacy directly, so downstream crates using the templated macro no longer need a direct data_privacy dependency. This mirrors the existing http re-export.