Created
September 18, 2021 00:05
-
-
Save v-stickykeys/0726fc536a5c49df8a63fbc30487781e to your computer and use it in GitHub Desktop.
Rust Rocket Bytes to String
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let string = "wgmi".to_string(); | |
println!("{:?}", string); | |
let bytes: Bytes = string.into(); | |
println!("{}", String::from_utf8(Vec::from(bytes.as_ref())).unwrap()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment