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

shouldn't we add Add for Cow<'a, str>? #35837

Closed
llogiq opened this issue Aug 19, 2016 · 1 comment
Closed

shouldn't we add Add for Cow<'a, str>? #35837

llogiq opened this issue Aug 19, 2016 · 1 comment

Comments

@llogiq
Copy link
Contributor

llogiq commented Aug 19, 2016

After some experience, I've changed my mind in Addition for strings. Let's do it for Cow too. The rationale is that we already have the addition via Deref and we can optimize for the case of adding empty strings (or Cows of them, respectively) – we can get rid of one clone in that case.

bors added a commit that referenced this issue Sep 29, 2016
impl Add<{str, Cow<str>}> for Cow<str>

cc #35837
@llogiq
Copy link
Contributor Author

llogiq commented Dec 28, 2016

This is now in stable, so it seems safe to close.

@llogiq llogiq closed this as completed Dec 28, 2016
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

No branches or pull requests

2 participants