I'm trying to do this, but doesn't work:
fn foo() {
let v = b"Hello".to_vec();
let a = v.as_bytes();
}
I'm getting:
error[E0599]: no method named `as_bytes` found for struct `Vec<u8>` in the current scope
--> foo
|
26 | let a = v.as_bytes();
| ^^^^^^^^ method not found in `Vec<u8>`