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

Prefer returning &str over String where applicable #878

Merged
merged 2 commits into from
Mar 24, 2023

Conversation

paolobarbolini
Copy link
Contributor

Split out of #876 because of breaking changes to the public API

Makes ServerAddr::username and ServerAddr::password conform with
the rest of the getters by not allocating.
Taking or returning a `&String` doesn't make sense.
Replace occurences of it with `&str`.
@caspervonb caspervonb changed the title Remove redundant allocations from the public API Prefer returning &str over String where applicable Mar 20, 2023
Copy link
Collaborator

@caspervonb caspervonb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Member

@Jarema Jarema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Jarema Jarema merged commit 2ad3c98 into nats-io:main Mar 24, 2023
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.

3 participants