Skip to content

Instantly share code, notes, and snippets.

@v-stickykeys
Created September 18, 2021 00:05
Show Gist options
  • Save v-stickykeys/0726fc536a5c49df8a63fbc30487781e to your computer and use it in GitHub Desktop.
Save v-stickykeys/0726fc536a5c49df8a63fbc30487781e to your computer and use it in GitHub Desktop.
Rust Rocket Bytes to String
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