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

AnyStr? #3

Open
CarlKCarlK opened this issue Oct 31, 2022 Discussed in #2 · 2 comments
Open

AnyStr? #3

CarlKCarlK opened this issue Oct 31, 2022 Discussed in #2 · 2 comments

Comments

@CarlKCarlK
Copy link
Owner

Discussed in #2

Originally posted by NicholasSterling October 30, 2022
Interesting crate -- thanks for the contribution.

This is a minor point, but when I saw AnyString I thought "oh no, if I had an &str, I wouldn't necessarily want it to be converted to a String." But the target type for AnyString is actually &str. So this leaves me with two thoughts:

  1. Would it be clearer to call that AnyStr?
  2. Do you want an AnyString (with a target type of String) too?
@Supermath101
Copy link

Supermath101 commented Dec 27, 2022

Or, you could have a more explicit name: AnyOwnedString, and either AnyBorrowedStr or AnyStrSlice?

@CarlKCarlK
Copy link
Owner Author

Thanks for the suggestions!

I'm leaning now to changing the current AnyString (which produces a &str) to AnyStr. I'll increment the version of the library because this would be a breaking change.

Then the question would be is should there be an "AnyString" that creates a String. I'm leaning towards not doing that until/unless there is demand.

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