Hi everyone,
I have found this topic, but it's not clear from it if there something changed in 2024 or not.
In my case, I need to turn any type into Vec<u8>
, so I've implemented trait for this case. All works nice except for signed integers.
So, my questions are:
- Do I still need to use
unsafe
code to convert signed integers into unsigned (or there smth better exists for such cases). - What is the difference when I just use
as
operator ? For example, I made this sandbox example and results are same when using bothas
andunsafe