Need help with Understanding Type Conversions in Rust

⚓ Rust    📅 2025-11-30    👤 surdeus    👁️ 3      

surdeus

Hello, I am a beginner to Rust and was confused on how Rust handles typings.

I have a hexadecimal key which I have been trying to use the Rc4 crate to create an instance of Rc4 by using
Rc4::new(hex::decode(KEY).into())

Since Rc4 expects a byte sequence and hex::decode returns Vec, I have been trying to convert the latter type to the former using into() but could not figure out the reason for failure.

From my understanding of types, Vec is a String and byte sequence is a &str, so I thought into() would work here.

4 posts - 4 participants

Read full topic

🏷️ Rust_feed