@hdevalence Yes, you are missing that the purpose of `Into` is to replace the value of the old type with the new value, not create a copy.
-
-
Functions that leave `self` unmodified and create some derived value are named `to_`, not `into_`. See https://aturon.github.io/style/naming.html#conversions …
-
ahhhhhhhhhh okay, that makes more sense now, thank you very much
-
Incidentally, if you're doing what I imagine you're doing then you can actually do it as `fn as_bytes(&'a self) -> &'a [u8]`
End of conversation
New conversation -
-
-
Yeah, that's what I'm doing. But then you can't call into(), b/c the derived impl is for &T, not T. You have to do (&t).into()
-
So I'm still confused how to get the function I want, which is `T::into_bytes(&self) -> [u8;32]`
-
`T::into_bytes(&self) -> [u8;32]` is incompatible with `impl Into<[u8;32]> for T` because Into always consumes self
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.