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

Change Name::new to take Into<String> instead of String #1283

Merged
merged 1 commit into from
Jan 22, 2021

Conversation

willcrichton
Copy link
Contributor

This reduces verbosity for &'static strings, e.g. Name::new("a name") instead of Name::new("a name".to_string()).

Copy link
Member

@DJMcNab DJMcNab left a comment

Choose a reason for hiding this comment

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

Makes sense to me. I wonder if it makes more sense to use Cow<'static, str> here? But that's a future discussion which isn't relevant to this PR.

@cart
Copy link
Member

cart commented Jan 22, 2021

Yeah I think using cow here makes a lot of sense. Y'all are free to follow up if you want :)

@cart cart merged commit ebcab36 into bevyengine:master Jan 22, 2021
@CleanCut
Copy link
Member

I attempted a Cow<'static, str> followup in #1308

rparrett pushed a commit to rparrett/bevy that referenced this pull request Jan 27, 2021
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.

4 participants