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

refactor(registry): improve constructors of Registry #238

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

koushiro
Copy link
Contributor

The current APIs of Registry does not allow me to change the prefix and labels of a Registry after it's constructed.

Breaking Changes:

  • change fn with_prefix(prefix: ...) -> Self => fn with_prefix(mut self, prefix: ...) -> Self
  • change fn with_labels(labels: ...) -> Self => fn with_labels(mut self, labels: ...) -> Self
  • remove fn with_prefix_and_labels(prefix: ..., labels: ...) -> Self

@koushiro koushiro force-pushed the refactor-registry-constructor branch from 6582dfe to 0b143af Compare November 10, 2024 14:33
@koushiro
Copy link
Contributor Author

koushiro commented Nov 10, 2024

BTW, I think the sub_registry part is not very useful, and it might be better to remove these sub_registry_* APIs to keep the Registry APIs simple (as long as the prefix and labels field of the registry are exposed, downstream users can implement these functionalities by themselves)

**Breaking Changes**:

- change `fn with_prefix(prefix: ...) -> Self` => `fn with_prefix(mut self, prefix: ...) -> Self`
- change `fn with_labels(labels: ...) -> Self` => `fn with_labels(mut self, labels: ...) -> Self`
- remove `fn with_prefix_and_labels(prefix: ..., labels: ...) -> Self`

Signed-off-by: koushiro <[email protected]>
@koushiro koushiro force-pushed the refactor-registry-constructor branch from 0b143af to 9bd363e Compare November 10, 2024 14:40
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