-
Notifications
You must be signed in to change notification settings - Fork 22
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
Implement Encode
for Cow<'a, str>
#27
Comments
AFAIK, // src/derive/impls.rs
impl<T: Encode + ToOwned + ?Sized> Encode for ::alloc::borrow::Cow<'_, T> {
type Encoder = DerefEncoder<T>;
} The hard, error-prone part would be
So I'm wondering: Would |
I think always opting for It looks like this is currently the case link (unless I'm reading it incorrectly). Could potentially add some tests for it, then if it's not feasible to keep the same repr it could be removed in some future breaking change? |
Note that |
Maybe that's the best
Yes. A possible reason for it to change would be if we needed one format for borrowing from the buffer (
Yeah I'm vaguely aware of that. Maybe we could do something similar. But, if we're going to detect I doubt this issue can proceed without input from @caibear 👀 |
I think the main learning from |
I think there are three cases (for the declared lifetime of the
|
Hey!
I'm trying to encode a
Cow<'static, str>
but I don't think it's implemented. Is this intentional?Please let me know if I'm missing something or if you don't have time to add it -- I can submit a PR :)
Thanks
The text was updated successfully, but these errors were encountered: