-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
Using ByteVec
consuming trait methods on BString fails with "cannot move out of dereference of BString"
#98
Comments
In terms of how to make progress here, I think you want But this is probably a specific example of a general problem. Namely, that
I know (2) would work, but would be clunky/unfortunate. I'm less sure about (1), since I wonder how trait method resolution would work for methods that take |
ByteVec
trait methods on BString fails with "cannot move out of dereference of BString"
ByteVec
trait methods on BString fails with "cannot move out of dereference of BString"ByteVec
consuming trait methods on BString fails with "cannot move out of dereference of BString"
Thanks for the analysis and for showing a way forward.
On the flip side, fixing this probably makes the API much more ergonomic, for instance, on |
It turns out that this is a duplicate of #84. Similar ideas on how to move forward are discussed there. To be honest, I'm still not quite sure what to do. If Anyway, closing in favor of #84 since it was created first and also has a fair bit of context/info there. |
My actual goal is to convert a BString into a String, in a way that errors if it's not UTF-8. Basically
String::from_utf8(my_bstring.into_inner())
.However, when trying it, I see 'cannot move out of dereference of
BString
', which makes sense as all functionality is implemented viaDeref
.The problem is that my API uses
BStr
and sometimesBString
so it would be desirable to be able dissolve the BString once again.Here is the playground link.
Thanks for your advice.
The text was updated successfully, but these errors were encountered: